TITLE: How to find the general formula for this recursive problem?
QUESTION [5 upvotes]: I want to ask about recursive problem.
Given: $$a_0= 11, a_1= -13,$$ and $$a_n= -a_{n-1} +2a_{n-2}.$$
What is the general formula for $$a_n$$ ?
I've already tried to find the first terms of this series. From there, I got:
$$a_2 = 35, a_3= -61,$$ and $$a_4= 131.$$
From there, I think I need to use the rule from arithmetic and geometric series to find the general formula that I want to find.
But, I cannot find the certain pattern from this series, because the differences is always changing, such that -24, 48, -96, 192. 
From there I think the general formula for a_n should be including (-1)ⁿ. But, how can we deal with series 24,48,96,192?
It seems the series is geometric, but how can we find the formula?
Thanks

REPLY [2 votes]: A useful trick here is to use a generating function.
Let $f(x)=\sum\limits_{n=0}^\infty a_nx^n$. Then we have that $f(x)=a_0+a_1x+\sum\limits_{n=2}^\infty a_nx^n=11-13x+\sum\limits_{n=2}^\infty (-a_{n-1}+2a_{n-2})x^n$. (1) Note that for this last sum: $\sum\limits_{n=2}^\infty (-a_{n-1}+2a_{n-2})x^n=-x\sum\limits_{n=2}^\infty a_{n-1}x^{n-1}+2x^2\sum\limits_{n=2}^\infty a_{n-2}x^{n-2}$. (2) Then, re-indexing the summations yields:
(2) $= -x\sum\limits_{n=1}^\infty a_nx^n+2x^2\sum\limits_{n=0}^\infty a_nx^n=-x\cdot(f(x)-a_0)+2x^2\cdot f(x)$.
Rewriting (1) and solving for $f(x)$ then yields $f(x)=\frac{11-2x}{1+x-2x^2}$. Writing out the Taylor series for this function and equating coefficients will then yield a formula for $a_n$.