It’s well known, and easy to prove, that
But here’s a generalization of that which has been attributed to Joseph Liouville (1809 – 1882). Pick any number, say 56, and write down all of its divisors:
Now, for each number in that list, write down the number of its divisors:
For example, 7 has 2 divisors (1 and 7), and 14 has 4 divisors (1, 2, 7 and 14). But for this second list, the sum of its cubes equals the square of its sum!
Here’s a quick check with Sage:
sage: n = 56 sage: L=[number_of_divisors(i) for i in divisors(n)];L [1, 2, 3, 2, 4, 4, 6, 8] sage: sum(L)^2,sum(i^3 for i in L) (900, 900)
And now to prove this result. Start by saying that a list has the square-cube (SC) property if the sum of its cubes equals to the square of its sum. So any list has the SC property, as does the list . Also define the pairwise product of two lists and to be the list consisting of all possible products of pairs of elements from and . In other words:
where of course is the Cartesian product. From the definition then it is easy to show that,
For example, if and then
with sum 60, which is equal to the product of the sums of and . Note that
It follows immediately from this that if and are two lists each of which has the SC property, then so does . To see this, suppose that
Multiplying these together produces
The right hand side is equal to
By the same reasoning as above, the left hand side is equal to
By induction, if is a collection of lists all with the SC property, then has the SC property.
Consider and its decomposition into prime factors:
For any prime power the number of divisors of is ; the divisors are all the powers of from 1 to . And the numbers of divisors of all those prime powers are . Consider now . The divisors are for all values of between 1 and , and all values of between 1 and . The number of divisors of are . From this it follows that the number of divisors of the divisors of is
and hence which has the SC property. The general result follows by induction on the number of distinct prime factors of .
Published proofs and further discussion can be found in “An Interesting Number Fact” by David Pagni, The Mathematical Gazette, Vol. 82, No. 494, Jul., 1998, and “Generalising ‘Sums of Cubes Equal to Squares of Sums’” by John Mason, The Mathematical Gazette, Vol. 85, No. 502, Mar., 2001.