mavery wrote:

I'm pretty sure it's:

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

So if we had use 4, it would be (4*5*9)/6 = 180/6 = 30

1 + 4 + 9 + 16 = 30

20 would be:

(20*21*41)/6 = 2870

You may want to check that...

wonderful - thanks!

seems to work for some no.s i tried. can you plz point me to some definitive reference on how this formula is arrived at - couldn't find it online.

also, is there a variation of this formula that is based on first term, difference, etc. (like arithmetic series Sum formula).

For example, is there a way to solve?

1. 1^2 + 3^2 + 5^2 + ...19^2

2. 4^2 + 7^2 + 10^2 + ...25^2