Sum of Squares Calculator
Add the squares of the first n whole numbers, 1² + 2² + … + n², with the closed-form formula and mean square.
How it works
Σ k² (k = 1…n) = n(n + 1)(2n + 1) ÷ 6
The sum of the first n squares has a neat closed form, n(n+1)(2n+1)/6, so you never have to add the squares one by one. It grows on the order of n³/3, which is why it drives the variance of a uniform set and the moment of inertia of evenly spaced masses. The mean square shown here — the sum divided by n — is the average of the squared values.
Worked example
For n = 10, the sum is 10 × 11 × 21 ÷ 6 = 2,310 ÷ 6 = 385. Adding 1 + 4 + 9 + … + 100 by hand gives the same 385.
Sources: Square pyramidal number — Wikipedia
Frequently asked questions
What is the formula for the sum of squares?
For the first n whole numbers it is n(n + 1)(2n + 1) ÷ 6. For n = 5 that is 5 × 6 × 11 ÷ 6 = 55, matching 1 + 4 + 9 + 16 + 25.
Is this the same "sum of squares" used in statistics?
Not quite. Statistics usually means the sum of squared deviations from a mean. This calculator adds the squares of the counting numbers 1 through n, a pure algebra identity.
How fast does the sum grow?
Roughly like n³/3, so it climbs much faster than the plain sum of integers. Doubling n multiplies the sum of squares by about eight.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.