I have the following expression, and I want to have a formula that gives me the coefficients of $\displaystyle x^{s}$ of this product.

$\displaystyle (x+x^2+x^3)^2$

This can be written like this:

$\displaystyle x^2(1-x^3)^2(1-x)^{-2}$

Now I used the binomial theorem:

$\displaystyle x^2(1-x^3)^2=\sum_{k=0}^{2}{2\choose k}(-1)^{k}x^{3k+2}$ and $\displaystyle (1-x)^{-2}=\sum_{r=0}^{\infty}{2+r-1\choose r}x^r$

So

$\displaystyle (x+x^2+x^3)^2=\sum_{k=0}^{2}{2\choose k}(-1)^{k}x^{3k+2}\sum_{r=0}^{\infty}{2+r-1\choose r}x^r$

But it doesn't seem right, and I don1t know how to rewrite it.