prove sum(x^2)=n(n+1)(2n+1)/2 from x=1 to x=n

should be:

n(n+1)(2n+1)/6

Do you know induction?