Sum of the first n squares

In our last post Volume of the Pyramid we showed that the volume of a truncated solid is the Base*(average of the height at the vertices) for the triangular and square prisms.

Lets now use that idea to calculate the sum of the first n squares.

12 + 22 + 32 + 42 + .... + n2

We can split that in:

1 + 2 + 3 + 4 + 5 + ..... + n
2 + 3 + 4 + 5 + ..... + n
3 + 4 + 5 + ..... + n
4 + 5 + ..... + n
5 + ..... + n
..... + n
. + n
n

If you picture the numbers as the heights of a solid it turns to be a truncated "linear" solid - since the variation is linear, there is also a more formal demonstration of the formula below.

The volume V is:

(B)*(average height at the vertexes)

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

So the sum of the first n squares is

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

You can also put this numbers forming a equilateral triangle rotate by 120o and 240 o and then sum the three versions, getting a nice prism,(it is you can check that). All that is a "3D version" of the classic argument.

1 + 2 +...+(n-1)+ n = S
n +(n-1)+....+2 + 1 = S

n*(n +1) = 2S

S = n*(n +1)/2

We also saw that using averages in the post sums.

3 comments:

Gavi said...

This can also be proved by induction.
base case: 0
0(0+1)/2=0- good
Inductive leap: Assumes it works for all N
Try n+1
(n(n+1)/2)+(n+1)=((n+1)(n+1+1)/2)
It does, you can do the algebra yourself.
There you have it.

Gavi said...

This can also be proved by induction.
base case: 0
0(0+1)/2=0- good
Inductive leap: Assumes it works for all N
Try n+1
(n(n+1)/2)+(n+1)=((n+1)(n+1+1)/2)
For the sake of time I'll tell you it does, you can do the algebra yourself.
There you have it.

Bankanidhi Sahoo said...

The problem with induction is : one has to know the final formula to start with.