Soma de Quadrados 1² até n²
- Created by
- Renato Passos, Eng. de Software
- Reviewed by
- Renato Passos, Eng. de Software
Last updated: Apr 18, 2026
Formula
S = n(n+1)(2n+1)/6
About this calculator
The sum of squares calculator quickly computes the value of 1² + 2² + 3² + ... + n², where n is a positive integer. The formula used is S = n(n+1)(2n+1)/6, a closed-form expression that avoids adding term by term. It is useful in mathematics, physics, and programming.
How it works: you enter the value of n (the last number in the sequence) and the calculator directly applies the formula. For example, for n = 5, the sum is 1² + 2² + 3² + 4² + 5² = 55. The formula confirms: 5×6×11/6 = 55. The result is provided instantly, without manual calculations.
When to use: this calculator is ideal for students checking sequence exercises, programmers implementing algorithms involving summations, or anyone dealing with counting problems or discrete area under curves. It is also useful in variance calculations and moments in statistics.
Common precautions: ensure n is a positive integer. The formula does not apply to fractional or negative values. Also, for very large n, the result can grow quickly; the calculator handles large numbers well, but being aware of the magnitude is advisable.
Frequently asked questions
Can I use the calculator for n = 0?
Yes, the formula also works for n = 0, resulting in 0. The calculator accepts n = 0.
What if I enter a decimal number?
The calculator expects an integer. If you enter a decimal, it will round or display an error. We recommend using only integers.
Does the formula work for negative numbers?
No, the formula was derived for natural numbers. For negative n, the result does not make sense in the context of sum of squares.
What is the difference between sum of squares and square of sum?
Sum of squares is 1² + 2² + ... + n². Square of sum is (1+2+...+n)². They are different results.
Can I use this calculator for sequences that do not start at 1?
Not directly. For sequences starting at another value, you need to compute the sum up to the largest number and subtract the sum up to the previous number.