<s>[INST] How many pairs of $(x,y,z)$ for $x+y+2z=n$ 
How many pairs of $(x,y,z)$ for $x+y+2z=n$ when $n$ is an odd integer $\geq 5$

For $n=5$ there are 2 pairs. $n=7$ there are 6 pairs. $n=9$ there are 12 pairs. $n=11$ there are 20 pairs.
$an^2 + bn + c = f(n)$
$25a + 5b + c = 2$
$49a + 7b + c = 6$
$81a + 8b + c = 12$
$f(n) = (n^2)/4 - n + 3/4 = (n-3)(n-1)/4$
Is there a better way to solve it?
 [/INST] For $x,y,z\in \mathbb{N}, x,y,z\geq 0$, 
When $n$ is odd, the number is:
$$ (n+1)+(n-1)+(n-3)+...+2=\frac{(n+1)(n+3)}{4} $$
when $n$ is even, the number is:
$$ (n+1)+(n-1)+(n-3)+...+1=(\frac{n+2}{2})^2 $$
</s>