In this question I found online:
- Show that $$ S(n):0^2 + 1^2 + 2^2 + · · · + n^2 = \frac{n(n + 1)(2n + 1)}{6}$$
I don't understand why for S(k+1) they wrote:
$$S(k+1):1^2+2^2+3^2+⋯+k^2+(k+1)^2=\frac{(k+1)(k+2)(2(k+1)+1)}{6}$$
instead of: $$S(k+1):1^2+2^2+3^2+⋯+(k+1)^2=\frac{(k+1)(k+2)(2(k+1)+1)}{6}$$
Why is the $k^2$ included in the $S(k+1)$ step I don't get it surely you just substitute $k+1$ for $n$ so I don't know why $k^2$ is needed there because in other proof by induction questions I've done for example for this proof: $$n<2^n$$
for the $k+1$ step the answer was not $$k + k + 1 < 2^k+1$$ it was: $$k+1 < 2^k+1$$
EDIT
People have mentioned that my version is correct and they just wrote it in a different way but why could I not prove both sides were equal? This is what I did:
$$S(k+1):1^2+2^2+3^2+⋯+(k+1)^2=\frac{(k+1)(k+2)(2(k+1)+1)}{6}$$
I expanded out $$(k+1)^2$$ which gave me $$k^2+2k+1$$
so going back to the k+1 statement we have:
$$S(k+1):1^2+2^2+3^2+⋯+k^2+2k+1=\frac{(k+1)(k+2)(2(k+1)+1)}{6}$$
I subbed in $$\frac{k(k+1)(2k+1)}{6}$$ for $$1^2+2^2+3^2+⋯+k^2$$ (the induction hypothesis) in the k+1 statement and got: $$\frac{k(k+1)(2k+1)}{6} + 2k+1=\frac{(k+1)(k+2)(2(k+1)+1)}{6}$$
long story short my proof failed and I couldn't prove both sides were equal but why was this if my version of S(k+1) was not incorrect?
$$\sum_{m=0}^{k+1} m^2.$$ They're writing it that way to emphasize that you're adding $(k+1)^2$ to the entire preceding sum (the sum arising from $S(k)$), but you're correct that they didn't have to write it out. They chose to do so for pedagogical (rather than mathematical) reasons.
– Robert Shore Aug 23 '21 at 22:20