TITLE: Number of non-negative whole number solutions if the coefficients of the variables are not equal to $1$
QUESTION [6 upvotes]: We know how to find the number of non-negative whole number solutions of the equation $x_1+x_2+x_3+...x_r=n$.It is given by $\binom{n+r-1}{r}$ by the method of stars and bars.
But how to find the number of non-negative whole number solutions if the coefficients of the variables are not equal to $1$ for all.
For example I take an equation like $2x_1+3x_2+5x_3=100$.How to find number of whole number solutions in this case?     
Is there any combinatorial way?Is there there any way to use binomial theorem/generating functions to solve this problem?

REPLY [4 votes]: As pointed out in this solution, the generating function for the number $f(n)$
of solutions to
$2x_1+3x_2+5x_3=n$
is 
$$ \frac{1}{(1-x^2)(1-x^3)(1-x^5)}.$$
The denominator expands to
$$1-x^2-x^3+x^7+x^8-x^{10},$$
which means that $f(n)$ satisfies the recurrence
$$f(n)=f(n-2)+f(n-3)-f(n-7)-f(n-8)+f(n-10).$$
With the initial conditions $f(0)=1$ and $f(n)=0$ for $n<0$, and a little patience, you can now work out $f(n)$ for $n\le100$ by hand if you want, and find $f(100)=184.$