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$.
The generating function is \begin{eqnarray*} \underbrace{\frac{1}{(1-x^4)}}_{a} \underbrace{(1+x)}_{b} \underbrace{\frac{1}{(1-x)^2}}_{c \text{ and } d } \underbrace{(1+x^2)}_{f}. \end{eqnarray*} Which can be simplified to \begin{eqnarray*} \color{blue}{\frac{1}{(1-x)^3}}. \end{eqnarray*}