<s>[INST] Generating Functions- Closed form of a sequence We are given the following generating function : $$G(x)=\frac{x}{1+x+x^2}$$
The question is to provide a closed formula for the sequence it determines.
I have no idea where to start. The denominator cannot be factored out as a product of two monomials with real coefficients. Any sort of help to solve this problem is welcome!
 [/INST] If you want the Binet formula for this you can solve the matrix
Set up the partial fraction 
$$\frac{x}{1+x+x^2}=\frac{A}{1-ax}+\frac{B}{1-bx}$$ where $$a=\frac{-1+\sqrt{3}i}{2}$$ and $$ b=\frac{-1-\sqrt{3}i}{2}$$ so that
$$A(1-bx)+B(1-ax)$$
The matrix becomes
\begin{bmatrix}
-b&-a&1\\[0.3em]
1&1&0
 \end{bmatrix}
or
\begin{bmatrix}
\frac{1+\sqrt{3}i}{2}&\frac{1-\sqrt{3}i}{2}&1\\[0.3em]
1&1&0
 \end{bmatrix}
which in reduced echelon form is 
\begin{bmatrix}
1&0&\frac{-\sqrt{3}i}{3}  \\[0.3em]
0&1&\frac{\sqrt{3}i}{3}
\end{bmatrix}
The closed form then becomes
$$a_n=\frac{-\sqrt{3}i}{3}\left(\frac{-1+\sqrt{3}i}{2}\right)^n+\frac{\sqrt{3}i}{3}\left(\frac{-1-\sqrt{3}i}{2}\right)^n$$
$a_0=0$ $a_1=1$, $a_2=-1$, $a_3=0$, $a_4=1$, $a_5=-1$ etc.
</s>