Sum of Cubes Calculator

Sum the cubes up to n³.

How it is calculated

Enter n, the number of terms: the tool adds the cubes of the whole numbers from 1 to n. Instead of looping, it first finds the triangular number s = n(n + 1) / 2 (the plain sum 1 + 2 + … + n) and then squares it, so 1³ + 2³ + … + n³ = s². n must be a whole number of at least 1; zero, negatives and decimals return no result. The answer is a single integer shown with thousands separators. Because only n is needed, a limit of 100,000 is as instant as a limit of 10.

Worked example

Let n = 10. Step 1: the sum of the first ten integers is 10 × 11 / 2 = 55. Step 2: square it, 55 × 55 = 3,025. You can verify by cubing term by term: 1 + 8 + 27 + 64 + 125 + 216 + 343 + 512 + 729 + 1,000 = 3,025. The shortcut gives the same total with two operations instead of ten cubes.

Try this example →

Common mistakes

  • Squaring n(n + 1) without halving it first. For n = 10 that gives 12,100, which is four times too big; the halved value 55 must be squared.
  • Confusing the sum of cubes 1³ + 2³ + … + n³ with a single cube such as n³, or with the sum of squares, which has a different formula.
  • Entering the largest base as a power, for example typing 1000 meaning "10³". The field expects how many consecutive cubes to add (n = 10), not the last cube.
  • Using the tool for a sum that skips terms, such as only even or odd bases; it always adds every integer from 1 to n.

About this calculator

The sum of cubes 1³ + 2³ + 3³ + ... + n³ has a remarkably clean closed form: it always equals [n(n+1)/2]² — in other words, the sum of the first n cubes is exactly the square of the sum of the first n integers. So for n = 4, the sum 1+8+27+64 = 100 equals (1+2+3+4)² = 10², and that pattern holds for every n.

This identity is a staple of algebra and discrete-math courses as an example of proof by mathematical induction, and it’s one of the most quoted “beautiful” identities in elementary number theory precisely because it links a cubic sum to a squared linear sum with no obvious reason why they should match. Beyond the classroom, the closed form lets programmers and engineers compute large cube sums in constant time instead of looping through every term, which matters in algorithm-complexity analysis and in generating test cases for numerical software.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators