The sum of powers adds the squares, the cubes or the higher powers of consecutive integers. The sum of powers calculator uses Faulhaber’s formulas to give the sum between two integers, the number of terms, the average term, the sum from 1 and the ratio to the last term, without adding the terms one by one.
How the calculation works
- Enter the first integer and the last integer of the sum. To sum from 1, enter 1 as the first integer.
- Choose the power: 1 for the integers, 2 for the squares, 3 for the cubes, and 4 or 5 for higher powers.
- The calculator uses Faulhaber’s formulas, for example 1² + … + n² = n (n + 1)(2n + 1) / 6 and 1³ + … + n³ = (n (n + 1) / 2)², with no loop.
- A sum between two integers is the sum up to the last integer minus the sum up to the integer before the first. The calculator also gives the number of terms, the average term and the ratio to the last term.
Example
Take the cubes of the integers from 5 to 50. The sum from 1 to 50 is (50 × 51 / 2)² = 1,275² = 1,625,625. The sum from 1 to 4 is 10² = 100. So the sum from 5 to 50 is 1,625,625 − 100 = 1,625,525. There are 46 terms, so the average term is 35,337.5. The sum is 13.004 times the last term 50³ = 125,000.
Why it matters
The calculator helps students who study series and induction, programmers who want to check a loop, teachers who prepare exercises and anyone who needs a quick total of squares or cubes. The closed formulas show how the total grows with the number of terms, which is useful to estimate the cost of an algorithm with nested loops.
Good to know
The calculator works for integers from 1 to 100,000 and powers from 1 to 5. For the largest values the total is very large and may exceed the precision of 15 digits of the computer, so the last digits can be inexact. A sum of the form 2² + 4² + … or of odd numbers can be found from the same formulas by a simple change, for example by taking the sum of squares up to 2n and removing the odd terms.
Related tools
The arithmetic-geometric series calculator handles sums with a ratio, the harmonic series calculator adds the inverses of the integers, the triangular numbers calculator gives the sum of the integers, and the polygonal numbers calculator handles other figurate numbers.