The question is: find the generating function for $(f_0,f_1,f_2,...)$ where $f_{n} = f_{n-1}+ 2f_{n-3}$ and $f_0 =0$ and $f_1 = f_2 = 1 $ I have solved this and reached G(x) = $(x-2)\over(2{x^3} + x - 1)$ but I see in Wolfram Alpha that this is not the answer
Can anyone Help?
update: my solution : $$G(x) = \sum_{n=0}^\infty f_nx^n = \sum_{n=3}^\infty f_nx^n + f_0+ f_1 + f_2 = \sum_{n=3}^\infty f_nx^n + 2$$
$$G(x)-2 =\sum_{n=3}^\infty (f_{n-1}+ 2f_{n-3})x^n = \sum_{n=3}^\infty f_{n-1}x^n + 2\sum_{n=3}^\infty f_{n-3}x^n$$ $$G(x) -2 = \sum_{n=2}^\infty f_nx^{n+1} + 2\sum_{n=0}^\infty f_nx^{n+3} $$ $$G(x) - 2 = x(G(x)-1) + 2x^3G(x) $$ $$ G(x) = {(x-2)\over(2x^3+x-1)}$$
so whats wrong?
As pointed out in the comments, the issue is that you go from $$ \sum_{n=0}^\infty f_nx^n $$ to $$ \sum_{n=3}^\infty f_nx^n + f_0 + f_1 + f_2 = \sum_{n=3}^\infty f_nx^n + 2 $$ which is not right. It ought to be $$ \sum_{n=3}^\infty f_nx^n + f_0 + f_1x + f_2x^2 = \sum_{n=3}^\infty f_nx^n + x + x^2 $$ instead.