I am pretty new when it comes to recursion together with induction. I would appreciate if somebody could show me how to approach this kind of problem: $$ a_n = \begin{cases} 1 & \text{if $n=1$} \\ 8 & \text{if $n=2$} \\ a_{n-1}+2\cdot a_{n-2} & \text{if $ n \in \mathbb{N}\setminus \left\{1,2 \right\}$} \end{cases} $$
Proof by induction that $$ a_n = 3 \cdot 2^{(n-1)} + 2(-1)^n $$
is true for all
$$ n \in \mathbb{N} $$
I would really appreciate some examples, as i am having a hard time to understand how to approach this (even though i do understand induction and how to use it properly, the recursion just gives me a hard time).
Thanks for taking your time!
We have as base cases that $a_1 = 3\cdot 2^{1-1} +2(-1)^1=3-2 = 1$ and Then $a_2 = 3\cdot 2^{2-1} + 2(-1)^2 = 6+2=8$.
So we just need to prove the induction step that if
$a_{n-1} = 3\cdot 2^{n-2} + 2(-2)^{n-1}$ and $a_n = 3\cdot 2^{n-1} + 2(-1)^n$ that that would mean
$a_{n+1} = 3\cdot 2^{n} + 2(-1)^{n+1}$.
And we have $a_{n+1} = a_{n-1} +2a_{n-2}$ by definitions so substituting:
$a_{n+1} = [3\cdot 2^{n-1} + 2(-1)^n] + 2[3\cdot 2^{n-2} + 2(-1)^{n-1}]$. So just do algebra
$= [3\cdot 2^{n-1} + 2(-1)^n] + [2\cdot 3\cdot 2^{n-2}+ 2\cdot 2(-1)^{n-1}]=$
$= [3\cdot 2^{n-1} + 2(-1)^n] + [3\cdot 2^{n-1} + 2\cdot 2(-1)^{n-1}]=$
$=(3\cdot 2^{n-1} + 3\cdot 2^{n-1}) + (2(-1)^n + 2\cdot 2(-1)^{n-1}]=$
$=2\cdot 3\cdot 2^{n-1} + 2(-1)^{n-1}(2-1)=$
$3\cdot 2^{n} + 2(-1)^{n-1}=$
$3\cdot 2^n + 2(-1)^{n-1}\cdot (-1)^2 = $
$3\cdot 2^n + 2(-1)^{n+1}$.
.....
It might be easier instead of writing $(-1)^m$ to write $\pm 1_{m;even/odd}$
Then $a_{n+1} = [3\cdot 2^{n-1} \pm 2] + 2[3\cdot 2^{n-2} \mp 2]=$ ($\pm = +$ if $n$ is even and $\pm = -$ if $n$ is odd; $\mp$ is the exact opposite.)
$[3\cdot 2^{n-1} + 2\cdot 3\cdot 2^{n-2}] + [\pm 2 \mp 2\cdot 2]=$
$[3\cdot 2^{n-1} + 3\cdot 2^{n-1}] + [\pm 2 \mp 4]=$
$2\cdot3\cdot 2^{n-1} \mp 2=$ ($\mp=-$ if $n$ is even or in other words if $n+1$ is odd and $\mp = +$ if $n +1$ is even.)
$3\cdot 2^n + (-1)^{n+1} 2=$