<s>[INST] Generating function for the solutions of equation $ 2x_1 + 4x_2 = n$ Let's denote $h_n$ as the number of soulutions of the following equation:
$$ 2x_1 + 4x_2 = n$$
where $x_i \in \mathbb N$.
Find generating function of the sequence $h_n$ and calculate $h_{2000}$.
I've found the generating function:
$$\frac{1}{1-x^2}\cdot \frac{1}{1-x^4},$$
but I don't know how to expand it now. Any ideas?
 [/INST] As stated, the generating function is:
\begin{align}
f(z) &= \frac{1}{1 - z^2} \cdot \frac{1}{1 - z^4} \\
     &= \frac{1}{4 (1 - z^2)} + \frac{1}{4 (1 + z^2)} + \frac{1}{2 (1 - z^2)^2}
\end{align}
(this results from recognizing the generating function as a fraction in $z^2$, and splitting as such into partial fractions). Thus the expansion is:
\begin{align}
f(z) &= \frac{1}{4} \sum_{k \ge 0} \left( 1 + (-1)^k \right) z^{2 k} 
          + \frac{1}{2} \sum_{k \ge 0} (-1)^k \binom{-2}{k} z^{2 k} \\
     &= \frac{1}{4} \sum_{k \ge 0} \left( 1 + (-1)^k \right) z^{2 k}
          + \frac{1}{2} \sum_{k \ge 0} \binom{n + 1}{1} z^{2 k} \\
     &= \frac{1}{4} \sum_{k \ge 0} \left( 1 + (-1)^k \right) z^{2 k}
          + \frac{1}{2} \sum_{k \ge 0} (k + 1) z^{2 k}
\end{align}
This gives the coefficients:
$$
h_n = \begin{cases}
         0                                           & \text{$n$ odd} \\
         \left\lfloor \frac{n}{4} \right\rfloor + 1  & \text{$n$ even}
      \end{cases}
$$
Thus $h_{2000} = 501$.
</s>