Edited in the light of Byron's correction to the original:
The answer is the coefficient of $u^x$ in the expansion of $$\sum_{y=0}^x(u^{a_1}+u^{a_2}+\cdots+u^{a_r})^y$$ which can be helpful if there is something special about $a_1,a_2,\dots,a_r$ enabling you to simplify this expression; otherwise, it's just a rewording of your problem. But this means your problem is no easier than that of finding a particular coefficient in this expansion, which suggests that most of the time there is no method significantly better than brute force; it's just a question of how cleverly you can arrange for the force to be applied.
As for making it "solvable in a few seconds," you may be asking for too much. Let's look in some detail at a very small example of what you want to do: how many ways to get 100 with 2s, 3s, and 5s?
Well, there's one way using just 5s. You could use 17 5s and 5 3s; there are 22-choose-5 ways to do that. Or you could use 14 5s and 10 3s; 24-choose-10 ways. Carrying on, we see that if you use just 3s and 5s, there are $$1+{22\choose5}+{24\choose10}+\cdots+{32\choose30}$$ ways. Now there's a similar formula for using just 2s and 5s, and another one for just 2s and 3s. Now what if we use 2s, 3s, and 5s? We could use 19 5s, a 3, and a 2; that gets you a multinomial coefficient, 21-choose-19,1,1. Then there's a 22-choose-18,2,2, and there's a 23-choose-17,3,3 and a 24-choose-17,1,6 and so on and so forth. A simple formula? Maybe, but I don't see it. Although I'd be interested to see what Henning's method does with this example.
Here is the tedious method that @antkam mentioned:
Consider the sums adding to 9. You have:
The set that contains $9$.
The set that contains $8$ must contain $1$.
The set that contains $7$ must contain $2$.
The set that contains $6$ must contain $3$ (Because it cannot contain $1$ and $2$, which are already used).
The set that contains $5$ must contain $4$ (Because $1, 3$ are both used).
There is but one way to distribute the numbers $1$ through $9$. All that is left is to choose where to put $0$. For that, there are $5$ ways (Any set can have $0$ in it).
Next, consider when the sum is $15$ ($3$ sets). We want to consider the most restrictive numbers first (As this will eliminate possibilities the fastest):
Let's write out all possible ways of summing to $15$ that contain a $9$ in non-zero digits:
$1+2+3+9,
1+5+9,
2+4+9,
6+9$
Next, do the same for $8$:
$1+2+4+8,
1+6+8,
2+5+8,
3+4+8,
7+8$
We only need to pick the first two sets (one set containing 9, one set containing 8). The rest of the digits will be in the third set. And, we can place the zero into any of the three sets, so every valid partition of the nonzero elements can be turned into three distinct partitions when we add in the zero.
$\{1,2,3,9\}$ can only pair with $\{7,8\}$: $3$ ways
$\{1,5,9\}$ can pair with $\{3,4,8\}$ or $\{7,8\}$: $6$ ways
$\{2,4,9\}$ can pair with $\{1,6,8\}$ or $\{7,8\}$: $6$ ways
$\{6,9\}$ can pair with $\{1,2,4,8\}$, $\{2,5,8\}$, $\{3,4,8\}$, or $\{7,8\}$: $12$ ways
Adding it all up, that is $5+3+6+6+12=32$ ways.
Best Answer
You can define this as a recurrence relation:
$$f(n, \ell, k) = \begin{cases} 1, & \text{if $n = k = 0$} \\ 0, & \text{if $n < 0$ or $k < 0$} \\ \sum_{i = 1}^{\ell}{f(n-i, i-1, k-1)}, & \text{otherwise} \end{cases}$$
This can be optimized when computing $f(n, \ell, k)$ by using memoization.
As @JMoravitz mentioned: