<s>[INST] Number of integer solutions of linear equation. I have the following problem.

Assume we have an unlimited number of blocks of 1cm, 2cm and 3cm height. Ignoring the position of the blocks, how many towers of 15cm height can we build?

I know I must find the coefficient of $x^{15}$ of the function
$$
f(x)=\frac{1}{1-x}\frac{1}{1-x^2}\frac{1}{1-x^3}=(1+x+x^2)\frac{1}{1-x^2}\frac{1}{(1-x^3)^2}
$$
How do I find it?
 [/INST] $\mathbf{\text{Remember :}}$ $$\sum_{k=0}^{\infty}\binom{n+k-1}{k}x^k= \bigg(\frac{1}{1-x}\bigg)^n$$
By using given formula ,

*

*$$\frac{1}{1-x}= \sum_{n=0}^{\infty}x^n=1+x+x^2+x^3+...$$ , so the coefficient of $x^n$ is $\binom{n+1-1}{n}$


*$$\frac{1}{1-x^2}= \sum_{k=0}^{\infty}(x^2)^k=1+x^2+x^4+x^6+...$$ , so the coefficient of $x^{2k}$ is $\binom{k+1-1}{k}$


*$$\frac{1}{1-x^3}= \sum_{m=0}^{\infty}(x^3)^m=1+x^3+x^6+x^9+...$$ , so the coefficient of $x^{3m}$ is $\binom{m+1-1}{m}$
where $n+2k+3m =15$ , so find the possible $n,k,m$ values that satify the equation and they are nonnegative integers such that

*

*$n=15,k=0,m=0$


*$n=13,k=1,m=0$


*$n=12,k=0,m=1$


*$n=11,k=2,m=0$


*$n=10,k=1,m=1$


*$n=9,k=3,m=0$


*$n=9,k=0,m=2$


*$n=8,k=2,m=1$


*$n=7,k=4,m=0$


*$n=7,k=1,m=2$


*$n=6,k=0,m=3$


*$n=6,k=3,m=1$


*$n=5,k=5,m=0$


*$n=5,k=2,m=2$


*$n=4,k=4,m=1$


*$n=4,k=1,m=3$


*$n=3,k=6,m=0$


*$n=3,k=3,m=2$


*$n=3,k=0,m=4$


*$n=2,k=5,m=1$


*$n=2,k=3,m=3$


*$n=1,k=7,m=0$


*$n=1,k=4,m=2$


*$n=1,k=1,m=4$


*$n=0,k=0,m=5$


*$n=0,k=3,m=3$


*$n=0,k=6,m=1$
As you see  , there are $27$ possible solution that satisfy the equation .Moreover , realize that whichever integer we put in place of $n,k,m$  , the result of binomial coefficient is $1$ , so we just need to sum how many possible solution there are , so the answer is $27$.
I highly recommend you to use wolfram or other softwares to calculate generating functions. I am putting a LINK
</s>