<s>[INST] Find the coefficient of $x^{18}$ in $(x + x^2 + x^3 + x^4 + x^5)(x^2 + x^3 + x^4 +\cdots)^5 $ 
Find the coefficient of $x^{18}$ in $$(x + x^2 + x^3 + x^4 + x^5)(x^2 + x^3 + x^4 +\cdots)^5 $$

This is the first time coming across a generating function question and am not quite sure how to solve this and am looking for some help, thanks!
 [/INST] Your expression can be rewritten as $$x(1+x+x^2+x^3+x^4)\cdot (x^2(1+x+x^2+x^3+\cdots)) ^5$$
$$=x(1+x+x^2+x^3+x^4)\cdot x^{10}(1+x+x^2+x^3+\cdots) ^5$$
$$=x^{11}(1+x+x^2+x^3+x^4)\cdot (1+x+x^2+x^3+\cdots) ^5$$
The two expressions in the brackets are finite and an infinite GP respectively.  Hence by formula for sum of GP we have
$$=x^{11}\cdot \left(\frac {1-x^5}{1-x}\right). \left(\frac {1}{1-x}\right) ^5$$
$$=x^{11}.\left (\frac {1-x^5}{(1-x)^6}\right) $$
$$=\left (\frac {x^{11}-x^{16}}{(1-x)^6}\right) $$
Now using the negative binomial series we need to find coefficient of $x^7$ and $x^2$ because we already have $x^{11} $ and $x^{16}$ in the numerator.
So using negative binomial series we get the answer as $$\binom {12}{5}- \binom {7}{2}=771$$
</s>