<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 you observed, if the generating function for $h_n$ is $$f(x) = h_0 + h_1x + h_2x^2 + h_3x^3 + \dots + h_nx^n + \dots,$$
then $$f(x) = (1 + x^2 + x^4 + x^6 + \dots)(1 + x^4 + x^8 + x^{12} + \dots) = \frac{1}{1-x^2}\frac{1}{1-x^4}$$
To actually get the coefficients of $x^n$ in the above, we resort to partial fractions. The denominator of the above can be factored into irreducible factors, using the identity $1-y^2 = (1+y)(1-y)$, as $(1+x)(1-x)(1+x^2)(1+x)(1-x) = (1+x)^2(1-x)^2(1+x^2)$. Therefore, by the general theory of partial fractions, $f(x)$ can be written as
$$f(x) = \frac{A}{1+x\vphantom{(1+x)^2}} + \frac{B}{(1+x)^2} + \frac{C}{1-x\vphantom{(1-x)^2}} + \frac{D}{(1-x)^2} + \frac{Ex + F}{1+x^2} + \frac{Gx + H}{(1+x^2)^2}$$
where $A, B, C, D, E, F, G, H$ are constants. Using various painful tricks it's possible to determine the constants, but because I'm not the one doing this as homework, I'll just turn to Wolfram Alpha which says that
$$f(x) = \frac{1}{4(1+x)} + \frac{1}{8(1+x)^2} + \frac{1}{4(1-x)} + \frac{1}{8(1-x)^2} + \frac{1}{4(1+x^2)}.$$
Here the five terms are, respectively, 
$\frac14 \sum_n{(-1)^n x^n}$ and
$\frac18 \sum_n {(-1)^n (n+1)x^n}$ and
$\frac14 \sum_n x^n$ and
$\frac18 \sum_n (n+1)x^n$ and
$\frac14 \sum_n{(-1)^n x^{2n}}$,
so $$h_{2000} = \frac14 (-1)^{2000} + \frac18 (-1)^{2000}2001 + \frac14 + \frac18 2001 + \frac14 (-1)^{1000} = 501.$$
[That's the answer, but as you can see the whole thing is a quite painful process that I wouldn't wish on my worst enemy, which is why I keep saying that generating functions are not the best way to solve these counting problems, despite the dazzle of the first step where you get some cute expression for the generating function.]

Edit: Just for contrast, the solution without generating functions: Clearly $n$ must be even, so we're counting solutions to $x + 2y = n/2$ in the nonnegative integers. From $0 \le 2y \le n/2$ we have $0 \le y \le \left\lfloor \frac{n/2}{2} \right\rfloor$, and for each such $y$ there is a unique $x = n/2 - 2y$ as solution. So the number of solutions (for even $n$) is $1 + \left\lfloor \frac{n/2}{2} \right\rfloor$, which for $n = 2000$ is $1 + \left\lfloor \frac{1000}{2} \right\rfloor = 501$.
The solution without generating functions is not always this simple, but I think this is a good example of how going down the generating functions route can be a bad idea if you want exact numbers (as opposed to asymptotic estimates, say).
</s>