#### Question

Prove the sum of squares sequence

1^2+2^2+3^2+\cdots +n^2= \cfrac{n(n+1)(2n+1)}{6}

Question

Prove the sum of squares sequence

1^2+2^2+3^2+\cdots +n^2= \cfrac{n(n+1)(2n+1)}{6}

A perfect square can be converted to difference of the following two numbers

n^2=n(n+1)-n ,

Then the sum of squares is transformed to a sequence in two difference pattens.

1^2+2^2+3^2+\cdots +n^2

=1×2+2×3+\dots+n(n+1) - (1+2+3+\dots+n)

Pattern 1 is the sum of products of two consecutive numbers.

Pattern 2 is the sum of natural numbers. Using the sum formula for an arithmetic sequence, the sum of the 2nd pattern is derived as

1×2+2×3+\dots+n(n+1) = \cfrac{n(n+1)}{2}

The product of two consecutive numbers can be further converted to difference of two different numbers as below

n(n+1)= \cfrac{n(n+1)(n+2)-(n-1)n(n+1)}{3}

Then sum of the products of two consecutive numbers is derived as

= \cfrac{1}{3}\big[ 1×2×3 - 0 +2×3×4- 1×2×3 +\dots+ n(n+1)(n+2)-(n-1)n(n+1)\big]

=\cfrac{n(n+1)(n+2)}{3}

Substituting the sums of both patterns yields the formula of the sum of squares sequence

1^2+2^2+3^2+\cdots +n^2 =\cfrac{n(n+1)(n+2)}{3} - \cfrac{n(n+1)}{2} = \cfrac{n(n+1)(2n+1)}{6}