<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] Define sequences $\{a_n\}$, $\{b_n\}$ and $\{c_n\}$ by
$$\begin{align}
\frac{1}{1-x^3} &= \sum_{n=0}^{\infty} a_n x^n \\
\frac{1}{1-x^3}\frac{1}{1-x^2} &= \sum_{n=0}^{\infty} b_n x^n \\
\frac{1}{1-x^3}\frac{1}{1-x^2} \frac{1}{1-x} &= \sum_{n=0}^{\infty} c_n x^n
\end{align}$$
Then we have $a_0=b_0=c_0=1$ and the recursive relations
$$\begin{align}
a_n &= [3 | n] \\
b_n &= b_{n-2}+a_n \quad \text{ for } n \ge 2\\
c_n &= c_{n-1}+b_n  \quad \text{ for } n \ge 1
\end{align}$$
where $[]$ is the Iverson Bracket: $[P] = 1$ if $P$ is true, $0$ otherwise. So $[3|n]= 1$ if $3$ divides $n$, otherwise $[3|n]=0$.
Using these relations and working from $n=0$ to $n=15$, we find $c_{15} = 27$.
</s>