Proof.
We proceed by strong induction on n. Observe that $a_0 = 2 = 3(0)^2 - 0 + 2$ and $a_1 = 4 = 3(1)^2 - 1 + 2.$
Assume that there is an integer k such that $a_j = 3j^2 - n + 2$ for all $2 < j < k.$
Then $a_{k+1} = 2a_k - a_{n-1} + 6$
Unsure of how to get right side equal to $a_n$. There is an example in the textbook but I couldn't wrap my head around how they got past this part.
Now, by the assumption of the induction: $$a_n=2(3(n-1)^2-(n-1)+2)-(3(n-2)^2-(n-2)+2)+6=3n^2-n+2.$$