How to find number of solutions of an equation? Given $n$, how to count the number of solutions to the equation $$x + 2y + 2z = n$$ where $x, y, z, n$ are non-negative integers?

We need the coefficient of $x^n$ in $(1+x+x^2+\cdots)(1+x^2+x^4+\cdots)^2$.
This can be written as 
\begin{align*}
\frac{1}{(1-x)(1-x^2)^2} &= \frac{1}{(1-x)^3(1+x)^2} \\
&= \frac{1/4}{(1-x)^3}+\frac{1/4}{(1-x)^2}+\frac{3/16}{1-x}+\frac{1/8}{(1+x)^2}+\frac{3/16}{1+x}
\end{align*}
The required coefficient is 
$$ \frac{1}{4}\binom{n+2}{n}+\frac{1}{4}\binom{n+1}{n}+\frac{3}{16}(n+1)+\frac{(-1)^n}{8}\binom{n+1}{n}+\frac{3(-1)^n}{16}$$
