<s>[INST] Number of Non negative integer solutions of $x+2y+5z=100$ Find Number of Non negative integer solutions of $x+2y+5z=100$
My attempt: 
we have $x+2y=100-5z$ 
Considering the polynomial $$f(u)=(1-u)^{-1}\times (1-u^2)^{-1}$$
$\implies$
$$f(u)=\frac{1}{(1-u)(1+u)}\times \frac{1}{1-u}=\frac{1}{2} \left(\frac{1}{1-u}+\frac{1}{1+u}\right)\frac{1}{1-u}=\frac{1}{2}\left((1-u)^{-2}+(1-u^2)^{-1}\right)$$ 
we need to collect coefficient of $100-5z$ in the above given by
$$C(z)=\frac{1}{2} \left((101-5z)+odd(z)\right)$$
Total number of solutions is
$$S(z)=\frac{1}{2} \sum_{z=0}^{20} 101-5z+\frac{1}{2} \sum_{z \in odd}1$$
$$S(z)=540.5$$
what went wrong in my analysis?
 [/INST] I will find number of solutions of equation $5x+2y+z=10 n$ in general:
clearly the positive solutions $x_0, y_0, z_0$ of this equation are corespondent to the solution $x_0+2,y_0, z_0$ of equation $5x+2y+z=10(n+1)$.Clearly for $x=>2$, finding the solutions of $5x+2y+z=10(n+1)$ will lead to finding the solution of first equation,provided we consider $x-2$ in first equation.
If the number of solutions of equation $5x+2y+z=10(n+1)$ is $\phi(n+1)$ and that of equation $5x+2y+z=10n$ is $\phi(n)$ the difference of  $\phi(n+1)$ and $\phi(n)$ is equal to the number of solutions of equation $5x+2y+z=10(n+1)$ for $x=0$ and $x=1$. But this equation has $5n+6$ solutions for $x=0$, (i.e. $0=<y=<5n+5)$ and it has $5n+3$ solutions for $x=1$, (i.e $0=<y=<5n+2)$. Therefore we have:
$\phi(n+1)-\phi(n)=10n+9$
We can also search and find  that $\phi(1)=10$, so we can write:
$\phi(1)=10$
$\phi(2)-\phi(1)=10\times 1+9$
$\phi(3)-\phi(2)=10\times 2+9$ 
.
.
.
$\phi(n)-\phi(n-1)=10(n-1)+9$
Summing theses relations gives:
$\phi(n)=5n^2 +4n +1$
In your question $n=10$, therefore number of solutions is $\phi(10)=5.10^2+4.10+1=541$
</s>