Maths & numbers

Sum of the first n cubes calculator

Evaluate a finite cube sum using the square of its triangular number.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

The identity uses the square of the entire triangular sum. It does not square each addend separately.

THE FORMULA[n(n+1)/2]²

A worked example

For n = 10, the triangular number is 55, and 55² = 3,025.

Good to know

An empty sum is zero.

Square the triangular total

For ten terms, the sum of the first ten integers is 10 × 11/2 = 55. Squaring that triangular number gives 55² = 3,025, which is also 1³ + 2³ + … + 10³. This identity reduces the computation to a short product and one square.

For three terms, the cube sum is 1 + 8 + 27 = 36. The triangular sum is 1 + 2 + 3 = 6, and 6² gives the same 36. The diagram shows the cube values adding to the square total rather than treating the three cubes as equal-sized objects.

The first three cubes add to thirty-six, the square of the third triangular number six1+8+271 + 8 + 27 = 3636 = 6²
The displayed values are 1³ = 1, 2³ = 8 and 3³ = 27. Their sum is 36 = (1 + 2 + 3)².

Distinguish cubing a sum from summing cubes

The identity uses the square of the ordinary sum. Cubing that sum would give 6³ = 216 for n = 3 and would be incorrect. The formula is [n(n + 1)/2]², so the exponent two applies to the entire triangular-number expression.

The Triangular number test calculator checks whether a supplied total is triangular. If its index is n, squaring that total gives the cube sum through n. For a subrange, subtract two cumulative cube sums. The values 4³ + 5³ equal 225 − 36 = 189 because the cube sum through five is 225 and the sum through three is 36.

A few questions, answered

Why is the cube sum always a perfect square?

The identity expresses it as the square of the integer triangular number n(n + 1)/2.

Is zero included as a cubed term?

Adding 0³ would change nothing. The tool defines the nonempty sum from 1³ through n³ and returns zero for an empty sum.

Find your calculator

Start typing to explore the library.