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

Variables

nUpper limit

Example

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

Did You Know?

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