$$a_{0} = 0$$ $$a_{1} = 1$$ $$a_{n} = a_{n-1} - a_{n-2}$$
I have to find the solution of this equation ($a_{n} = ...$, non-recursive, you know what I mean...). So let's pretend that:
$$ A(x) = \sum_{n=0}a_{n}x^{n}$$
Using this formula and the recursive equation I'm getting:
$$A(x) = xA(x) - x^{2}A(x)$$
Substituting $t = A(x)$, solving simple quadratic equation, and I'm getting two solutions:
$t = A(x) = \frac{1 - i\sqrt{3}}{2}$ or $t = A(x) = \frac{1 + i\sqrt{3}}{2}$
So actually this should be the right side of the generating function $A(x)$, it also has no variable so it already is a coefficient - the job is done.
However, the book shows different results, and they differ a lot. Let me write it:
$a_{n} = -\frac{i\sqrt{3}}{3}(\frac{1+i\sqrt{3}}{2})^{n mod6}$ or $a_{n} = \frac{i\sqrt{3}}{3}(\frac{1-i\sqrt{3}}{2})^{n mod6}$
What did I do wrong?