Sum of cubes

"Pick any old number you want . . .
Now take all the digits and cube them and add the cubes together . . .
Take that new number and do the same thing . . ."


Pat Ballew introduced this problem on his blog. G.H. Hardy said, there is nothing in [this] which appeals much to a mathematician. The proofs are neither difficult nor interesting . . ." Nevertheless, I thought it was worthy of some inspection, or at least a pretty picture.

I made a graph

It turns out that all terminal points or cycles are no more than four digits, so I explored all four-digit numbers. This is my first experiment with GraphViz, which is free. I made a graph; it appears below.

So how many nodes are there?

$$ \begin{array}{cccccc} \mbox{partition of }4 &\mbox {How many} \ldots & \mbox{ Classes of that type } & \times & \mbox{Numbers in each class } & = & \mbox{Numbers of that type} \\ 4 & 5 {10 \choose 1} - 1 & 9 & \times & 1 & = & 9 \\ 3+1 & 2 {10 \choose 2} & 90 & \times & 4 & = & 360 \\ 2+2 & {10 \choose 2} & 45 & \times & 6 & = & 270 \\ 2+1+1 & 3{10 \choose 3} & 360 & \times & 12 & = & 4320 \\ 1+1+1+1 & {10 \choose 4} & 210 & \times & 24 & = & 5040 \\ &\bf{Totals:}&\overline{714}&&&&\overline{9999} \\ \end{array} $$

Here are some fun facts

And finally, the graph:

Click on the thumbnail to launch in a new window.

What if we considered all five digit numbers?

$$ \begin{array}{cccccc} \mbox{partition of }5 &\mbox {How many} \ldots & \mbox{ Classes of that type } & \times & \mbox{Numbers in each class } & = & \mbox{Numbers of that type} \\ 5 & 5 {10 \choose 1} - 1 & 9 & \times & 1 & = & 9 \\ 4+1 & 2 {10 \choose 2} & 90 & \times & 5 & = & 450 \\ 3+2 & 2{10 \choose 2} & 90 & \times & 10 & = & 900 \\ 3+1+1 & 3{10 \choose 3} & 360 & \times & 20 & = & 7200 \\ 2+2+1 & 3{10 \choose 3} & 360 & \times & 30 & = & 10800 \\ 2+1+1+1 & 4{10 \choose 4} & 840 & \times & 60 & = & 50400 \\ 1+1+1+1+1 & {10 \choose 5} & 252^* & \times & 120 & = & 30240 \\ &\bf{Totals:}&\overline{2001}&&&&\overline{99999} \\ \end{array} $$ * - To generate these, I was excited, becuase I actually got to use the hockey-stick rule, $$\sum_{i=0}^{n} {i+k \choose k} = {n+1 \choose k+1}. $$

Tree sizes

How many numbers terminate with . . . 3 digit numbers 4 digit numbers 5 digit numbers
191001195
136, 24491601490
919, 1459243413070
407303963931
160, 217, 352514384140
55, 250, 133665185253
370174177618185
371303293729402
153333333333333