<s>[INST] Prove by induction: for every integer $n > 0$, $a_n = 2 \cdot 3^n + n^2-6$ I am working on what should be a simple induction proof exercise. However, I'm not sure if I am failing to simplify an expression after substitution correctly, or whether a prior step is incorrect.
The exercise:
Let $a_1 = 1$ and for every integer $n > 0$ let $$a_{n+1} = 3a_n - 2n^2 + 2n + 13$$
Use induction to prove that for every integer $n > 0$ $$a_n = 2 \cdot 3^n + n^2 - 6$$
My steps:

*

*Let $P(n)$ be the statement that for every integer $n > 0$, $a_n = 2 \cdot 3^n + n^2 - 6$

*For $n = 1$, $a_1 = 2 \cdot 3^1 + 1^2 - 6 = 1$. Thus, $P(1)$ is true.

*Suppose that $P(k)$ is true. That is, $a_k = 2 \cdot 3^k + k^2 - 6$.

*Then (using substitution to replace $a_n$ in the given definition for $a_{n+1}$), $$a_{k+1} = 3(2 \cdot 3^k + k^2 - 6) - 2k^2 + 2k + 13 = (2 \cdot 3^{k+1}) + k^2 + 2k -5$$
This is not the needed result.
Is my error in the simplification of the expression in step 4? Or is a previous step (also) incorrect?
 [/INST] It is the needed result if you notice $$(2\cdot 3^{k+1}) + k^2 + 2k - 5 = (2\cdot 3^{k+1}) + k^2 + 2k +1 - 6 = (2\cdot 3^{k+1}) + (k+1)^2 - 6$$
</s>