What is the sum of squares?
The sum of squares of the first n positive integers is the total you get by squaring each whole number from 1 up to n and adding the results: \(1^2 + 2^2 + 3^2 + \ldots + n^2\). Instead of adding every term one at a time, you can use a famous closed-form formula that gives the answer in a single step, no matter how large n is.
The formula explained
The compact identity is:
$$\sum_{k=1}^{n} k^2 = \frac{n\left(n+1\right)\left(2\,n+1\right)}{6}$$
Here n is the largest integer in your sequence. Multiply n by \((n+1)\) and by \((2n+1)\), then divide by 6. The result is always a whole number because the product of these three factors is always divisible by 6. This calculator also reports the related sum of integers, \(\frac{n(n+1)}{2}\), and the mean of the squares.
How to use this calculator
Enter the upper limit n — the last integer in the series — and the tool returns the exact sum instantly. Use it to check homework, verify code, or speed up statistics work, since sums of squares appear in variance, standard deviation, and regression formulas.
Worked example
Suppose n = 5. The terms are 1, 4, 9, 16, 25, which add to 55. Using the formula: $$\frac{5 \times 6 \times 11}{6} = \frac{330}{6} = 55.$$ The closed form matches the direct addition perfectly.
FAQ
Does this work for any n? Yes — for any positive whole number n. Very large values still compute instantly thanks to the formula.
Why divide by 6? The product \(n(n+1)(2n+1)\) is always a multiple of 6, which is why the formula yields an integer.
Can I include 0? Adding \(0^2 = 0\) does not change the sum, so the result for n stays the same whether or not you count zero.