TITLE: Finding a closed-form formula for a sequence that is defined recursively
QUESTION [5 upvotes]: $$a_0 = 0, a_1 = 1 \quad \text{ and } \quad a_n = a_{n-1} + 2a_{n-2}\quad \text{ for }n\geq 2$$
a) Find $a_2,a_3,a_4,a_5$
b) Find a closed form-formula for $a_n$
I found the value to be $(a_n)_{n\in \Bbb N} = \{0, 1, 1, 3 , 5, 11, ...\}$
I have not the slightest clue how to find a closed form formula, so if anyone could help me out with this I would be greatly appreciated.
I've seen similar questions with answers talking about finding a geometric series, but I can assure that this question should not require knowledge of such since we have not done anything of the sort in class.
Is it just trial and error to find such a formula? Or is there a set method to follow?
I noticed that the formula is very similar to the Fibonacci sequence:
$$F(n) = F(n-1) + F(n-2)$$
Thanks.

REPLY [2 votes]: Linear recurrence relations with constant coefficients produce exponentially growing terms in the sequence. Hence, we can assume the closed form solution to $a_n$ is some type of exponential function in $n$. Simply, let
$$a_n = r^n$$
for some constant $r$ to be determined. For the recurrence relation you provided, we can make a substitution:
$$r^n = r^{n-1} + 2r^{n-2}$$
Dividing both sides of the equation by $r^{n-2}$, knowing that $r^{n-2}$ is not zero for $n>2$, yields
$$r^2 = r + 2$$
Now the solution to $r$ is easier to find. This is known as the auxiliary equation or characteristic equation. So, we get $r = -1$ or $r = 2$. This makes it look like there are two solutions for $a_n$, one with $r=-1$ and the other with $r=2$, but really $a_n = r^n$ is some linear combination of the powers of each root (-1 and 2), which means
$$a_n = c_0 (-1)^n + c_1 (2)^n$$
where $c_0$ and $c_1$ are the linear coefficients. Make the substitutions $a_0=0$ and $a_1=1$ to get the following system of two equations:
$$0 = c_0 + c_1$$
$$1 = -c_0 + 2c_1$$
The solution for $c_0$ and $c_1$ gets plugged back into the expression for $a_n$ to get the final answer:
$$a_n = -\frac{1}{3}(-1)^n + \frac{1}{3}2^n$$
The method I just described here only works when there are two distinct characteristic roots (in this case, we had -1 and 2, which are different numbers, so this works). Otherwise, a minor change is needed to make it all work.