Key Points
The sum of squares formula is , closing the sum into a single expression.
The OEIS lists these totals as the square pyramidal numbers, with the same closed form .
The name has a second meaning in statistics, where sum of squares refers to , the summed squared deviations.
One of the three factors , and is always divisible by 3 and the pair , supplies a factor of 2, so the result is always a whole number.
Squaring the sum is not the same as summing the squares, and conflating the two is the dominant error on this topic.
What Is the Sum of Squares Formula?
The sum of squares formula gives a closed expression for :
The On-Line Encyclopedia of Integer Sequences records these values as the square pyramidal numbers and gives exactly this closed form.
Why the Formula Gives a Whole Number
The division by 6 looks as though it might leave a fraction, and it never does. Among any three consecutive integers one is divisible by 3, and , , always contains such a multiple.
The factor of 2 comes free from and , since consecutive integers cannot both be odd. Together they guarantee divisibility by 6.
A quick proof sketch uses the identity . Summing both sides from to collapses the left side to , and rearranging the right side for gives the formula.
Variable Key
Symbol | Meaning | Unit or type | Notes |
|---|---|---|---|
how many terms | positive integer | the last number squared | |
summation index | integer | runs from 1 to | |
the sum of squares | integer | the quantity being computed | |
closed form | integer | always divides exactly |
Examples of the Sum of Squares Formula
Example 1
Find using the formula.
Final answer: 30, matching .
Example 2
Find the sum of the squares of the first 10 whole numbers by squaring the sum.
The sum of 1 through 10 is 55, so squaring it looks like a shortcut:
That is far too large. Squaring the total multiplies every pair of terms together as well as each term by itself, so it counts far more than the ten squares asked for.
Using the formula instead:
Final answer: 385. Note that and are different quantities.
Example 3
Find .
Final answer: 2870
Example 4
Find the sum of the squares from 6 to 10 inclusive.
Subtract the first five from the first ten:
Final answer: 330
Subtracting a shorter run from a longer one handles any partial range without a new formula.
Example 5
Find the statistical sum of squares for the sample 4, 6, 8.
Here the term means summed squared deviations, not squares of counting numbers. The mean is 6, and the deviations are :
Final answer: 8, which divided by gives the sample variance of 4.
Two Different Quantities Share This Name
Meaning | Formula | Where it is used |
|---|---|---|
Sum of the first squares | series, counting, algebra | |
Sum of squared deviations | variance, standard deviation | |
Total sum of squares (ANOVA) | the corrected sum of squares about the grand mean | analysis of variance |
Square of the sum | a different value entirely |
The NIST e-Handbook uses the statistical sense, splitting a total sum of squares into a treatment part and an error part when analysing variance.
Sum of Squares, Where Things Go Sideways
Mistake 1: Squaring the sum instead of summing the squares
Where it slips in: Both phrases contain the same words, and the sum is quicker to compute.
Don't do this:
The correct way: . For the two give 3025 and 385, so the gap is not subtle.
Students who write out the first three terms before reaching for any formula catch this instantly, because looks nothing like .
Mistake 2: Using as the count when the range does not start at 1
Where it slips in: The formula assumes the sum begins at .
Don't do this: Apply with for the squares from 6 to 10.
The correct way: Compute the full sum to 10 and subtract the sum to 5, as in Example 4.
Mistake 3: Mixing the two meanings of the term
Where it slips in: A statistics question says "sum of squares" and the algebraic identity is applied.
Don't do this: Use on a data set.
The correct way: Check whether the squares are of the counting numbers or of deviations from a mean. The presence of a data set rather than a value of settles it.
Bottom Line
The sum of squares formula is .
These totals are the square pyramidal numbers, counting spheres stacked in a square pyramid.
The division by 6 is always exact, because the three factors supply a 2 and a 3 between them.
The same phrase means summed squared deviations in statistics, so check which quantity a question wants.
To work through series with a teacher, explore an algebra tutor or math classes online.
Where to Go From Here
Find , then the sum of the squares from 11 to 15 by subtraction, and check that the two shorter sums add back to the first.
Want a live Bhanzu trainer to walk through more series problems? Book a free demo class.
Read More
Was this article helpful?
Your feedback helps us write better content