<s>[INST] Number of non-negative integral solutions of $2x+3y+z=19$ The question is to find the number of solutions of $2x+3y+z=19$.
There are posts like this with answers arrived by counting the possibilities. But I decided to approach it in a different way.

My Approach:
I learnt a theorem stating that 

The number of integral solutions of $$a_1x_1+a_2x_2+a_3x_3...+a_nx_n=r$$ is the coefficient of $x^r$ in $$(1+{x}^{a_1}+{x}^{2\cdot{a_1}}+...+{x}^{\left \lfloor{\frac{r}{a_1}}\right \rfloor\cdot{a_1}})\cdot(1+{x}^{a_2}+{x}^{2\cdot{a_2}}+...+{x}^{\left \lfloor{\frac{r}{a_2}}\right \rfloor\cdot{a_2}})...(1+{x}^{a_n}+{x}^{2\cdot{a_n}}+...+{x}^{\left \lfloor{\frac{r}{a_n}}\right \rfloor\cdot{a_n}})$$ (I don't know the name of this theorem)

Substituting and reducing the equation, I landed up with finding coefficient of $x^{19}$ in $${\frac{1-x^{20}}{1-x^2}}\cdot{\frac{1-x^{21}}{1-x^3}}\cdot{\frac{1-x^{20}}{1-x}}$$
But, I had no clue of finding that.

My doubts:

*

*Is there any other relatively elegant way of finding it? (Other than counting or stars and bars - as in here)

*If no, how to solve further to get the answer?

Thanks in advance...
 [/INST] You can try directly. We see that $0\leq y\leq 6$
case 1: $y=6$ then we have $2x+z=1$, so $z=1$ and $x=0$;
case 2: $y=5$ then we have $2x+z=4$, so $x=2,z=0$ or $x=1,z=2$ or $x=0, z=4$;
case 3: $y=4$ then we have $2x+z=7$, so $0\leq x\leq 3$ so we have 4 solution
case 4: $y=3$ then we have $2x+z=10$, so $0\leq x\leq 5$ so we have 6 solution
case 5: $y=2$ then we have $2x+z=13$, so $0\leq x\leq 6$ so we have 7 solution
case 6: $y=1$ then we have $2x+z=16$, so $0\leq x\leq 8$ so we have 9 solution
case 7: $y=0$ then we have $2x+z=19$, so $0\leq x\leq 9$ so we have 10 solution
Thus we have total $1+3+4+6+7+9+10 = 40$  solutions.
</s>