Induction has many faces, a straightforward way to prove the equality using induction is
1. RSolve
It is superior because we needn't know the formula. Denote s[n] to be the sum 1^2 + 2^2 +...+ n^2 for every natural n, then obviously the axiom of induction is equivalent to : s[n+1] - s[n] == (n+1)^2, and the initial condition is : s[0] == 0, thus :
RSolve[{s[n + 1] - s[n] == (n + 1)^2, s[0] == 0}, s[n], n] // Factor
{{s[n] -> 1/6 n (1 + n) (1 + 2 n)}}
we have proved the equality.
Alternatively we could use
2. FindSequenceFunction
giving a few successive sums 1^2 + 2^2 +...+ n^2, it appears we need the first 5 sums :
FindSequenceFunction[{1, 5, 14, 30, 55}, n] // Factor
1/6 n (1 + n) (1 + 2 n)
Another the most obvious way using induction more or less implicitly is
3. Sum
for a general natural n we have :
Sum[ k^2, {k, n}]
1/6 n (1 + n) (1 + 2 n)
One can find an indetermined sum as well, but then the index starts at 0, therfore one needs to substitute n -> n+1 implying , e.g :
Sum[n^2, n] /. n -> n + 1 // Simplify
1/6 n (1 + n) (1 + 2 n)
Sum[k^2, {k, n}] // Factorgenerating the expression you want? – 0x4A4D♦ Oct 19 '12 at 15:10