Discrete Math sequence question The question is find $a3$:
$a_0 = 2, a_1 = 4$ and $a_{k+2} = 3a_{k+1}-a_k$ for any integer $k \geq 0 $
I know the answer is 26, although how do you get the answer?

$ a_0 =2 , a_1 = 4, a_{k+2} - 3a_{k+1} +a_k = 0 $
We can suggest an equation that $ x^2 -3x +1 = 0 $,
Let the roots of the equation are $ x_1 , x_2$
then $x_1 +x_2 = 3$, $x_1 x_2 = 1$
then $a_{k+2} - 3a_{k+1} +a_k = 0 $$ \Leftrightarrow $ $a_{k+2} - (x_1 +x_2 )a_{k+1} + x_1 x_2 a_k = 0$
$\Leftrightarrow$ $ a_{k+2} - x_1 a_{k+1} = x_2 ( a_{k+1} - x_1 a_k) $
$\Rightarrow$ $a_{k+1} - x_1 a_k = x_2 (a_k - x_1 a_{k-1} )$
$\Rightarrow$ $a_{k+2} - x_1 a_{k+1} = (x_2)^2 (a_{k} - x_1 a_{k-1})  $
= $ \dots$ = $(x_2)^k (a_2 - x_1 a_1)$
also, $ a_{k+2} - x_2 a_{k+1} = (x_1)^k (a_2 - x_2 a_1) $
then $ (x_2 - x_1)a_{k+1}  = (x_1)^k (a_2 -x_2 a_1) - (x_2)^k (a_2 -x_1 a_1)$
then $a_{k+1} = \frac{(x_1)^k (a_2 -x_2 a_1) - (x_2)^k (a_2 -x_1 a_1)}{x_2 - x_1}$
$ \therefore  a_k = \frac{(x_1)^{k-1} (a_2 -x_2 a_1) - (x_2)^{k-1} (a_2 -x_1 a_1)}{x_2 - x_1} $
