Number Theory
Intermediate

Sum of First n Cubes

The sum of the first n cubes equals the square of the sum.

Formula

∑k=1nk3=(n(n+1)2)2\sum_{k=1}^{n} k^3 = \left(\frac{n(n+1)}{2}\right)^2

Live Calculator

Members

Variables

nUpper limit

Example

1³ + 2³ + 3³ = 36 = 6² = (1+2+3)² — always a perfect square.

How it works

This identity says that if you add the cubes 1^3, 2^3, 3^3, and so on up to n^3, the result is exactly the square of the triangular number 1+2+...+n. In other words, the volume-like growth of cubes matches a perfect square pattern. One way to understand why it works is that the sum of cubes can be built from the pattern of consecutive sums: the area under the "staircase" of the first n integers squares itself, giving ((n(n+1))/2)^2.

When to use it

Use this formula when you need the total of a sequence of consecutive cubes without adding each term manually. It is especially useful in algebra, contest problems, and proofs involving patterns or sums of powers.

Worked example, step by step

Find the sum of the first 5 cubes. Use the formula: sum from k=1 to n of k^3 = (n(n+1)/2)^2 Substitute n = 5: (5(5+1)/2)^2 Simplify inside the parentheses: (5·6/2)^2 = 15^2 Compute the square: 15^2 = 225 So, 1^3 + 2^3 + 3^3 + 4^3 + 5^3 = 225

Common mistakes to avoid

  • Forgetting to square the triangular number and only computing n(n+1)/2
  • Using n^3 instead of summing all cubes from 1 to n
  • Misplacing parentheses, such as writing n(n+1)/2^2 instead of ((n(n+1))/2)^2

Did You Know?

The sum of the first n cubes equals the square of the nth triangular number — a beautiful coincidence.

Share this formula

Reviewed & maintained by the FormulaWon editorial teamLast reviewed September 2026