Happy Number - Cubing The Digits Rather Than Squaring

Cubing The Digits Rather Than Squaring

An interesting extension to the Happy Numbers problem is to find the sum of the cubes of the digits rather than the sum of the squares of the digits. For example, working in base 10, 1579 is happy, since:

13+53+73+93=1+125+343+729=1198
13+13+93+83=1+1+729+512=1243
13+23+43+33=1+8+64+27=100
13+03+03=1

In the same way that when summing the squares of the digits (and working in base 10) each number above 243(=3*81) produces a number which is strictly smaller, when summing the cubes of the digits each number above 2916(=4*729) produces a number which is strictly smaller.

By conducting an exhaustive search of one finds that for summing the cubes of digits base 10 there are happy numbers and eight different types of unhappy number:

those that eventually reach which perpetually produces itself.

those that eventually reach which perpetually produces itself.

those that eventually reach the loop

those that eventually reach which perpetually produces itself.

those that eventually reach the loop

those that eventually reach which perpetually produces itself.

those that eventually reach the loop

those that eventually reach the loop

Starting with the happy numbers and then following with the unhappy numbers in the order given above, the density of each type of number in the interval is 1.54%, 28.4%, 34.7%, 5.73%, 17.4%, 4.60%, 3.60%, 2.67% and 1.34% (all to 3 significant figures).

Intriguingly, the second type of unhappy number includes all multiples of three . This fact can be proved by the exhaustive search up to 2916 and noting that a number is a multiple of three if and only if the sum of digits is a multiple of three if and only if the sum of its cubed digits are a multiple of three. By similar reasoning, all happy numbers of this type must have a remainder of 1 when dividing by 3.

One interesting result which comes from the above work is that the only positive whole numbers which are the sum of the cubes of their digits are 1, 153, 370, 371 and 407.

Read more about this topic:  Happy Number