The sum 1^2 + 2^2 + 3^2 + ... + n^2 = n(n + 1)(2n + 1)/6.
What is the value of 21^2 + 22^2 + 23^2 + ... + 40^2 + 41^2 + 42^2?
The sum = sum of all the squares 1 through 42 minus the sum of all the squares 1 through 20
So we have
42 (43) (85)/6 - 20 (21)(41)/6 =
22715