Formula for the number of integer solutions of an equation (using generating functions) Let $a_n$ be the number of integer solutions of $$i+3j+3k=n$$ where $i \geq 0, j \geq 2, k \geq 3$.
I want to use the generating function of $(a_n)_{n \in \mathbb N}$ to get a formula for $a_n$.
We just introduced generating functions, so I'm fairly new to this stuff and hope you can help me solve this problem.
I began by interpreting the problem as a power series. Without the restrictions for $i, j, k$ I get
$$(1+x+x^2+x^3+\dots)(1+x^3+x^6+x^9+\dots)^2.$$
Accounting for $i \geq 0, j \geq 2, k \geq 3$ should get me something like
$$(1+x+x^2+x^3+\dots)(x^6+x^9+x^{12}+\dots)(x^9++x^{12}+x^{15}+\dots).$$
Is that correct?
Now I tried to simplify this like this:
$$1+x+x^2+x^3+\dots = \frac{1}{1-x}$$
$$x^6+x^9+x^{12}+\dots
=(1+x^3+x^6+x^9+x^{12}+\dots)-(1+x^3)
=\frac{1}{1-x^3}-(1+x^3)
=\frac{x^6}{1-x^3}$$
and likewise
$$x^9++x^{12}+x^{15}+\dots = \frac{x^9}{1-x^3}.$$
So I have
$$(1+x+x^2+x^3+\dots)(x^6+x^9+x^{12}+\dots)(x^9++x^{12}+x^{15}+\dots)
=\frac{x^{15}}{(1-x)(1-x^3)^2}.$$
I hope I didn't make a mistake already. In any case, here I'm stuck. I have to find a formula for the $n$-th coefficient in this power series, but I don't know how to do it.

[edit]
I'm still quite confused, but I'll try to go over it again one by one. Here is again the complete (and hopefully correct) partial fraction decomposition and my try to expand it:
$$\frac{1}{(1 - x)^3 (x^2 + x + 1)^2} \\
=\frac{1}{27} \frac{7x + 8}{x^2 + x + 1}
+ \frac{1}{9} \frac{2x+1}{(x^2 + x + 1)^2}
+ \frac{1}{27} \frac{7}{1-x}
- \frac{1}{9} \frac{2}{(1-x)^2}
+ \frac{1}{9} \frac{1}{(1-x)^3} \\
=\frac{1}{27} \frac{(7x + 8)(1-x)}{(1-x^3)}
+ \frac{1}{9} \frac{(2x+1)(1-x)^2}{(1-x^3)^2}
+ \frac{1}{27} \frac{7}{1-x}
- \frac{1}{9} \frac{2}{(1-x)^2}
+ \frac{1}{9} \frac{-1}{(1-x)^3} \\
=\frac{ (7x + 8)(1-x)}{27} \sum x^{3n}
+ \frac{ (2x+1)(1-x)^2}{9} \sum (n+1) x^{3n}
+ \frac{7}{27} \sum x^n
- \frac{2}{9} \sum (n+1) x^n
+ \frac{1}{9} \sum x^{3n}.$$
Still to do: Multiply by $x^{15}$ and find the coefficient of $x^k$.

OK, use generating functions. Note that $1 - z^3 = (1 - \omega z) (1 - \omega^2 z) (1 - z)$, where $\omega = -\frac{1}{2} + \mathrm{i} \frac{\sqrt{3}}{2}$ and $\omega^3 = 1$:
\begin{align}
[z^n] z^{15} (1 + z &+ z^2 + \ldots) (1 + z^3 + z^6 + \ldots)^2 \\
  &= [z^{n - 15}] \frac{1}{(1 - z) (1 - z^3)^2} \\
  &= [z^{n - 15}] \frac{1}{(1 - z)^3 (1 - \omega z)^2 (1 - \omega^2 z)^2}
\end{align}
This can be split into partial fractions, but the coefficients are very ugly. They can be simplified by $\omega^2 + \omega + 1 = 0$ and $\omega^3 = 1$. Use of a computer algebra system is mandatory.
Once you've got the partial fractions, you can use:
$$
\binom{-m}{k} = (-1)^k \binom{k + m - 1}{m - 1}
$$
The imaginary components cancel out, and you get real coefficients. One way to express them is to use Euler's formula:
$$
\omega^n
  = \exp( \mathrm{i} \frac{2 \pi n}{3} )
  = \cos \frac{2 \pi n}{3} + \mathrm{i} \sin \frac{2 \pi n}{3}
$$
