It’s well known that the sum of the cubes of the first *n* integers equals the square of their sum:

1^{3} + 2^{3} + 3^{3} + 4^{3} + 5^{3} = (1 + 2 + 3 + 4 + 5)^{2}

California State University mathematician David Pagni found another case in which the sum of cubes equals the square of a sum. Take any whole number:

28

List all its divisors:

1, 2, 4, 7, 14, 28

Count the number of divisors of each of these:

1 has 1 divisor

2 has 2 divisors

4 has 3 divisors

7 has 2 divisors

14 has 4 divisors

28 has 6 divisors

Now cube these numbers and sum the cubes:

1^{3} + 2^{3} + 3^{3} + 2^{3} + 4^{3} + 6^{3} = 324

And sum the same set of numbers and square the sum:

(1 + 2 + 3 + 2 + 4 + 6)^{2} = 324

The two results are the same: The sum of the cubes of these numbers will always equal the square of their sum.

(David Pagni, “An Interesting Number Fact,” *Mathematical Gazette* 82:494 [July 1998], 271-273.)

03/10/2017 UPDATE: Reader Kurt Bachtold points out that this was originally discovered by Joseph Liouville, a fact that I should have recalled, as I’d written about it in 2011. (Thanks, Kurt.)