Possible Duplicate:

How do I come up with a function to count a pyramid of apples?

Proof that n∑k=1k2=n(n+1)(2n+1)6?

Finite Sum of Power?I know that the sum of the squares of the first n natural numbers is n(n+1)(2n+1)6. I know how to prove it inductively. But how, presuming I have no idea about this formula, should I determine it? The sequence a(n)=12+22+...+n2 is neither geometric nor arithmetic. The difference between the consecutive terms is 4, 9, 16 and so on, which doesn’t help. Could someone please help me and explain how should I get to the well known formula assuming I didn’t know it and was on some desert island?

**Answer**

This is proven, for example, in Stewart’s *Calculus*:

Consider the following sum:

n∑i=1((1+i)3−i3).

First, looking at it as a telescoping sum, you will get

n∑i=1((1+i)3−i3)=(1+n)3−1.

On the other hand, you also have

n∑i=1((1+i)3−i3)=n∑i=1(3i2+3i+1)=3n∑i=1i2+3n∑i=1i+n.

Using these two expressions, and the fact that ∑ni=1i=n(n+1)2, you can now solve for ∑ni=1i2.

**Attribution***Source : Link , Question Author : Straightfw , Answer Author : M Turgeon*