EDIT: Turns out that the given solution has an error in it.
I have the following recursion question and following that is my answer. The problem is it doesn't seem to agree with the marking scheme. Can you help me by pointing out where i have gone wrong?
Question:
Use substitution to solve the recurrence equation $a_n = a_{n-1}+n^2$ for $n\ge1$, given $a_0 = 7$
My answer
step 1: $a_n = a_{n-1}+n^2$
step 2: $a_n = a_{n-2}+(n-1)^2+n^2$
step 3: $a_n = a_{n-3}+(n-2)^2+(n-1)^2+n^2$
step i :$a_n = a_{n-i}+\sum_{j=0}^{i-1} (n-j)^2$
since
$n-i=0$ then
$n=i$
therefore:
$a_n=a_0+\sum_{j=0}^{n-1} (n-j)^2$
$a_n=7+\sum_{j=0}^{n-1} (n-j)^2$
End of my answer
Now the marking scheme has something totally different which i don't understand
So again, where am i going wrong?
Should be
$$a_n = 7 + \sum_{j=0}^{n-1}\left(n-j\right)^2=7+\frac{1}{6}n\left(n+1\right)\left(2n+1\right)$$
provided solution simplified the series incorrectly.