Number of solutions to $a + b + c + d + f = n$ in nonnegative integers $a, b, c, d, f,$ given restrictions on $a, b,$ and $f$ Count the number of solutions to $a + b + c + d + f = n$ in nonnegative integers $a, b, c, d, f,$ such that $a$ is a multiple of 4, $b$ is at most 1, and $f$ is either 0 or 2.
My attempt:
As far as I know, you can solve these types of problems using generating functions or multisets.  For this problem, it makes sense to use generating functions.  Here's what I have so far:
For $a$: $(x^4 + x^8 + x^{12} + ... ) = \frac{1}{1-x^4}$ 
For $b$: $(x^0 + x^1) = \frac{1-x^2}{1-x}$
I'm stuck at what to do for $f$.

A non-generating function approach: Note that given any integer $m$ there is exactly one triple $a,b,f$ such that $m=a+b+f$ and $a$ is a multiple of $4$, $b\in\{0,1\}$ and $f\in\{0,2\}$. (Hint: Write $m$ in base $2$.) 
So the number of such solutions is exactly the same as the number of solutions to $c+d+m=n$.
[This can be seen with the generating function approach because $1-x^4=(1-x)(1+x)(1+x^2)$.]

You'd get the same result of you required $a$ to be a multiple of $9$, $b\leq 2$ and $f\in\{0,3,6\}$. Then you'd write $n$ is base $3$.
