TITLE: What is the closed form of the $f$ with $f(1)=1$, $f(2)=7$ and $f(n)=7f(n-1)-12f(n-2)$ ($n\ge 3$)?
QUESTION [16 upvotes]: Suppose $f(1)=1$ and $f(2)=7$. For $n\ge 3$ we have 
  $$f(n)=7f(n-1)-12f(n-2).
$$
  What is the closed form of the function $f$?


I've tried unrolling it but it gets very complicated very quickly without a clear pattern emerging. Any ideas?

REPLY [4 votes]: Say we have $$\boxed{a_{n+1} = (x+y)a_n-xya_{n-1}}$$ then we can do: $$a_{n+1}-xa_n = y(a_n-xa_{n-1})$$ and $$a_{n+1}-ya_n = x(a_n-ya_{n-1})$$
Putting $\boxed{b_n =a_n-xa_{n-1}}$ and $\boxed{c_n = a_n-ya_{n-1}}$ we can finish as before.
In general $x,y$ are solution of quadratic (characteristic) equation $t^2-pt-q=0$ of  recursion $$a_{n+1} = pa_n+qa_{n-1}$$

One more example: $$a_{n+1} = 2a_n+8a_{n-1}.$$ Then we can do $$a_{n+1}+2a_n = 4(a_n+2a_{n-1})$$ and $$a_{n+1}-4a_n = -2(a_n-4a_{n-1})$$
Then with $b_n =a_n+2a_{n-1}$ and $c_n = a_n-4a_{n-1}$ we are done...