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

and

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.

Filed under: Computation, Sage

Jeff U, on January 11, 2011 at 3:55 am said:Great result, but is it really a “generalization”? It’s clearly related but I don’t see the original result as a special case.

kcrisman, on January 14, 2011 at 2:17 am said:Sure it’s a generalization, though not 100% obvious.

Remember, the list has to come from the number of divisors of the divisors of a number. So pick $p^n$; the divisors are exactly $[1,p,p^2,\ldots,p^n]$, so the number of divisors of each of those is $[1,2,3,\ldots,n+1]$.

What a cool result! I’ll be sure to use it the next time I teach number theory.

kcrisman, on January 14, 2011 at 2:18 am said:In fact, Alasdair essentially uses this in the proof, which I should have read carefully before responding :)

Adnan Elhan, on January 13, 2011 at 4:39 am said:Quite interesting.

E. E. "pat" Ballew, on January 16, 2011 at 2:27 am said:Very nice… Think I need to take some time to wrap my head around it…thanks

Walking Randomly » Carnival of Mathematics #74 – The Tungsten Edition, on February 8, 2011 at 3:09 pm said:[…] Last but by no means least, Guillermo Bautista, organiser of the Math and Multimedia blog carnival, gives us an introduction to similarity while Alasdair’s Musings brings us A cute result relating to sums of cubes. […]

Severus Snape, on March 5, 2011 at 9:05 pm said:Pity it is all completely plagarised – but that is the way with most of this so called “academics” work.

amca01, on March 5, 2011 at 9:28 pm said:Is it really? Where from? I know the result is old, but I hadn’t seen this proof before! Please send me the links. (I haven’t actually read the articles I referenced at the end.)

kcrisman, on April 16, 2011 at 3:17 am said:Snape, that’s flame-bait! I wouldn’t say plagiarized, just well-known, as amca01 himself points out.

I hadn’t seen this proof before either. As it turns out, because he didn’t use the standard $\tau$ notation for the ‘number of divisors’ function, I forgot that this is a standard ‘hard’ exercise in many number theory texts. But a nice way to present it, and nice way to introduce it for folks who are not familiar with arithmetic functions.

Reilly, on July 8, 2011 at 7:10 am said:This must be some unfamiliar usage of the word “plagiarized” – the author presents a well known theorem, then a cute result that is attributed to Liouville. This is popularization, not plagiarism, bringing to light an interesting but perhaps unknown-to-the audience result. I found it interesting and learned something, thus it served its purpose for me. Plagiarism would have been if the author had claimed the result as his own, which he very clearly did not.

Felicity, on April 28, 2011 at 5:34 pm said:Heh heh – sucked in my love. Severus S.xxx

bad, on November 26, 2012 at 8:02 am said:I’m extremely pleased to uncover this web site. I need to to thank you for ones time for this particularly wonderful read!! I definitely liked every little bit of it and I have you book marked to look at new stuff on your blog.

John Richardson, on May 23, 2013 at 5:49 am said:Coming late to this party, but just wanted to add that the original “sum of the first n cubes equals the square of the sum of the first n integers” is clearly a special case of Liouville’s rule. Consider any nth power of some prime p, eg 3^4 = 81. It has five divisors, ie 81, 27, 9, 3 and 1. 27 has four divisors. 9 has three. 3 has two. And 1 has one. The rest should be obvious.

Weekend miscellany | John D. Cook, on January 17, 2015 at 10:16 am said:[…] Math blogs: MathBlogging.org Dynamical systems on a plane Exotic spheres ESP and statistics Sums of cubes […]