HAPPY NUMBERS

## Some Interesting Observations

----------------------------------------------------------------------------------------

Introduction

If you iterate the process of summing the squares of decimal digits of a number, then it is easy to see that you either reach the cycle

4 → 16 → 37 → 58 → 89 → 145 → 42 → 20 → 4

or you arrive at 1. In the latter case you started from a happy number.

For example, 7 is happy, as the process of summing the squares of decimal digits of 7 reach the number 1 as illustrated below:

72 = 49
42 + 92 = 97
92 + 72 = 130
12 + 32 + 02 = 10
12 + 02 = 1.

(a) It seems that about 1/7 of all numbers are happy, but what bounds on the density can be proved?

(b) How many consecutive happy numbers can you have? Can there be arbitrarily many?

(c) We define the height of a happy number to be the least number of iterations needed to reach 1. How big is the least happy number of height h?

(d) What if we replace squares by cubes, fourth powers, fifth powers etc., or we work in different bases?

All happy numbers up to 1000 are :

1, 7, 10, 13, 19, 23, 28, 31, 32, 44, 49, 68, 70, 79, 82, 86, 91, 94, 97, 100, 103, 109, 129, 130, 133, 139, 167, 176, 188, 190, 192, 193, 203, 208, 219, 226, 230, 236, 239, 262, 263, 280, 291, 293, 301, 302, 310, 313, 319, 320, 326, 329, 331, 338, 356, 362, 365, 367, 368, 376, 379, 383, 386, 391, 392, 397, 404, 409, 440, 446, 464, 469, 478, 487, 490, 496, 536, 556, 563, 565, 566, 608, 617, 622, 623, 632, 635, 637, 638, 644, 649, 653, 655, 656, 665, 671, 673, 680, 683, 694, 700, 709, 716, 736, 739, 748, 761, 763, 784, 790, 793, 802, 806, 818, 820, 833, 836, 847, 860, 863, 874, 881, 888, 899, 901, 904, 907, 910, 912, 913, 921, 923, 931, 932, 937, 940, 946, 964, 970, 973, 989, 998, 1000.

Various Kinds of Happy Numbers

• Happy Triangular Number:

A triangular number that is also a happy number can be termed a happy triangular number . For example, 28 is a happy triangular number as

28 → 22 + 82 = 70 → 72 + 02 = 49 → 42 + 92 = 97 → 92 + 72 = 130 → 12 + 32 + 02 = 10 → 12 + 02 = 1

Other examples of happy triangular numbers are:

1, 10, 28, 91, 190, 496, 820, 946, 1128, 1275, 2080, 2211, 2485, 3321, 4278, 8128, 8256, 8778, 9591, 9730, 11476, 12090, 12880, 13203, 13366, 13530, 15753, 16471, 17205, 17578, 20910, 21115, 21321, 22791, 24753, 25651, 27261, 29890, 30135, 31626, 33670, 35245, 36046, 41328, 43660, 43956, 44253, 46360, 47586, 48205, 50721, 53301, 53956, 54615, 55278, 56280, 56953, 58311, 61425, 62128, 66430, 69378, 69751, 70125, 75855, 76245, 77815, 79003, 80200, 81810, 82621, 84666, 87571, 90100, 90951, 93961, 99681 etc.

• Palindromic Happy Numbers:

A happy number that is palindromic ( i.e. reading the same forward as well as backward) can be termed a Palindromic happy numbers .

Examples of palindromic happy numbers are:

1, 7, 44, 262, 313, 383, 404, 464, 565, 656, 818, 888, 989, 1221, 1771, 1881, 2112, 3553, 4004, 4554, 4774, 5335, 5445, 5555, 7117, etc.

• Fibonacci Happy Numbers:

The Fibonacci numbers, which are also happy numbers can be termed as Fibonacci happy Numbers.

Examples of Fibonacci happy numbers are:

1, 13, 2584, 4181, 75025, 2178309, 3524578, 1134903170, 12586269025, 99194853094755497, etc.

• Happy Square Numbers:

Happy numbers, which are perfect squares, can be termed as happy square numbers .

Examples of happy square numbers are:

1, 49, 100, 784, 1444, 1521, 3364, 4096, 4225, 4356, 4900, 7225, 7744, 8281, 9604, 10000, 11025, etc.

• Happy Cubic Numbers:

Happy numbers, which are perfect cubes, can be termed as happy cubic numbers .

Examples of happy cubic numbers are:

1, 1000, 4096, 12167, 13824, 15625, 74088, 226981, 250047, 300763, 531441, 704969, 778688, 1000000, 1092727, etc.

• Repdigit Happy Numbers:

Happy numbers, whose all digits are same ( i.e. repeated digits) can be termed a repdigit happy number .

Examples of repdigit happy numbers are:

1, 7, 44, 888, 5555, 88888, 1111111, 2222222, 22222222, 77777777, 1111111111, 7777777777, 22222222222, 44444444444, 444444444444, 1111111111111, 4444444444444, 7777777777777, 999999999999999, 7777777777777777, etc.

Heights of Happy Numbers

Height of a happy number is defined as the number of iterations required to reach 1. For example, 1 is a happy number of height 0, 10 is a happy number of height 1, 13 is a happy number of height 2, 23 is a happy number of height 3, 19 is a happy number of height 4, 7 is a happy number of height 5 and 356 is a happy number of height 6 as illustrated below:

1 → 1
10 → 1 + 0 = 1
13 → 1 + 9 = 10 → 1 + 0 = 1
23 → 4 + 9 = 13 → 1 + 9 = 10 → 1 + 0 = 1
19 → 1 + 81 = 82 → 64 + 4 = 68 → 36 + 64 =100 → 1 + 0 + 0 = 1
7 → 49 → 16 + 81 = 97 → 81 + 49 = 130 →1 + 9 + 0 = 10 → 1 + 0 = 1
356 → 9 + 25 + 36 → 70 → 49 →97 → 130 → 10 → 1

In fact, the least happy numbers of height 0, 1, 2, 3, 4, 5 and 6 are 1, 10, 13, 23, 19, 7 and 356 respectively. Let least happy number of height h is denoted by Nh. Guy [1] reports that Jud McCranie verified that the least happy number of height 7 (i.e. N7) is 78999 and least happy number of height 8 (i.e. N8) is 977-digit number 3788(9)973. The notation (9)n means that the digit 9 is repeated n times.

78999 → 49 + 64 + 81 + 81 + 81 = 356 → 70 → 49 → 97 → 130 → 10 → 1

3788(9)973 → 9 + 49 + 64 + 64 + 973 * 81 = 78999 → 356 → 9 + 25 + 36 → 70 → 49 → 97 → 130 → 10 → 1

Guy [1] asks about the bound of the least happy number with height h?

It is easy to find the least happy numbers of heights up to 6 by computing the heights of each happy number less than 400. Grundman and Teeple [7] introduced a method to find the least happy numbers of given heights and by this method they found the least happy numbers of heights 7 to 10. T. Cai and X. Zhou [6] gave a general method to find the least happy number of any given height theoretically and determined the least happy numbers of heights 11 and 12. They used Lagrange’s four squares theorem which states that every positive integer can be represented as the sum of four squares. Based on this they have found least happy numbers of heights 9 to 12 as given below:

N9 = 78889 * 10(N8 -305) / 81 -1

N10 = 259 * 10(N9 -93) / 81 -1

N11 = 179 * 10(N10 -114) / 81 -1

N12 = 47 * 10(N11 -52) / 81 -1

Consecutive Happy Numbers

There are consecutive numbers which are all happy numbers also, these can be termed as consecutive happy numbers. The smallest pair of consecutive happy numbers is 31 and 32. The smallest with 3, 4 and 5 consecutive happy numbers are (1880, 1881, 1882), (7839, 7840, 7841, 7842) and (44488, 44489, 44490, 44491, 44492) respectively. Guy [1] asked how many consecutive happy numbers one can have and can there be arbitrarily many? El-Sedy and Siksek [2] published the first proof that there can be arbitrarily long strings of consecutive happy numbers.

Robert Styer [8] found the smallest string of consecutive happy numbers of length 6 to 13 as given in Table 1

Table 1

 Length k Least number of the sequence of k-consecutive happy numbers No. of digits 2 31 2 3 1880 4 4 7839 4 5 44488 5 6 7899999999999959999999996 25 7 7899999999999959999999996 25 8 58(9)116(9)1445 159 9 26(9)1377(9)745 215 10 38(9)5600(9)875 651 11 27(9)2800(9)12874 1571 12 388(9)1580218(9)1364 158162 13 288(9)2184913(9)3852033 603699

Note: The notation (9)n means that the digit 9 is repeated n times.

How many happy numbers are there?

The number of happy numbers is infinite. This is obvious because in the infinite set 1, 10, 100, 1000, 10000...all the numbers are happy. However, the density of the happy numbers is not yet known. Guy [1] mentioned that “It seems that about 1/7 of all numbers are happy” and asks for the density of happy numbers. Table 2 shows the number of happy numbers up to 1016.

Table 2

 n Number of happy numbers up to n Percentage 101 3 30.00 102 20 20.00 103 143 14.30 104 1442 14.42 105 14377 14.38 106 143071 14.31 107 1418854 14.19 108 14255667 14.26 109 145674808 14.57 1010 1492609148 14.93 1011 15091199357 15.09 1012 149121303586 14.91 1013 1443278000870 14.43 1014 13770853279685 13.77 1015 130660965862333 13.07 1016 1245219117260664 12.45

It can be seen that the proportion of happy numbers is rising continuously from 107 to 1011 and then falling up to 1016. The density of happy numbers does not seem to exist.

Concatenated Happy Numbers

Let us denote the sequence of Happy numbers as H-sequence. So, H = { 1, 7, 10, 13, 19, 23, 28, 31, 32, 44, 49, 68, 70, 79, 82, 86, 91, 94, 97 ,100 ..........}. Concatenated sequence of Happy numbers or Concatenated H-sequence is the sequence formed from concatenation of numbers in H-sequence. So, concatenated H-sequence is
1, 17, 1710, 171013, 17101319, 1710131923, 171013192328, ............
Let us denote the nth term of the concatenated H-sequence by CH(n). So, CH(1)=1
CH(2)=17
CH(3)=1710
CH(4)=171013 and so on.

On investigating concatenated H-sequence, it was found that

(a) There are 1429 happy numbers in first 10000 terms of concatenated H-sequence and hence belongs to the initial H-sequence. The first few Happy numbers in the concatenated H-sequence are CH(1), CH(11), CH(14), CH(30), CH(31), CH(35), CH(48), CH(52), CH(62), CH(67), CH(69), CH(71), CH(76), etc. So, about one-seventh of numbers in the concatenated H-sequence belong to the initial H-sequence. It may be noted that SH(10000) consists of 48396 digits.

(b) There are only 3 primes in the first 1000 terms of concatenated H-sequence. These are CH(2) = 17, CH(5) = 17101319 and CH(43), which is 108 digit prime. It may be noted that CH(1000) consists of 3837 digits.

Similarly , reversed concatenated H-sequence can be defined as the sequence formed from the concatenation of happy numbers (H-sequence) written backward i.e. in reverse order. So, reversed concatenated H-sequence is
1, 71, 1071, 131071, 19131071, 2319131071, 282319131071, ... .
Let us denote the nth term of the reversed concatenated H-sequence by RCH(n). So, RCH(1)=1
RCH(2)=71
RCH(3)=1071
RCH(4)=131071 and so on.

On investigating reversed concatenated H-sequence, it was found that there are 8 primes in first 1000 terms of reversed concatenated H-sequence as against only 3 primes in concatenated H-sequence. These primes are:
RCH(2)=71
RCH(4)=131071
RCH(5)=19131071
RCH(6)=2319131071
RCH(10)=44323128231913131071
Other three primes are RCH(31), RCH(255) and RCH(368) which consists of 72, 857 and 1309 digits respectively.

Some Interesting Observations

• All numbers are either happy or unhappy numbers.
• Since addition of zeros does not change the sum of squares of digits of a number, all numbers in the sequence 1,10,100,1000.. are happy numbers. Similarly since 28 is happy number so, 280, 2800, 28000 ..etc. and 208, 2080, 2008…etc. are all happy numbers. Hence there are infinitely many happy numbers.
• Rearranging the digits (permutations) of a number does not change the sum of squares of digits of that number, so if a number say 145 is a happy number, so 154, 514, 541, 415 and 451 are also happy numbers.
• Smallest Pandigital (i.e. containing all digits from 0 to 9) happy number is 10234456789.
• Smallest zeroless Pandigital (i.e. containing all digits from 1 to 9) happy number is 1234456789.
• Smallest Pandigital (i.e. containing all digits from 0 to 9) palindromic happy number is 1034567892987654301.
• Smallest zeroless Pandigital (i.e. containing all digits from 1 to 9) palindromic happy number is 13456789298765431.

-----------------------------------------------------------------------------------------------------

[1] Richard. K. Guy, Unsolved Problems in Number Theory, Springer-Verlag, New York, 2004.

[2] Esam. El-Sedy and Samir. Siksek, On happy numbers, Rocky Mountain J. Math., 30 (2000), 565–570.

[3] H. G. Grundman and E. A. Teeple, Generalized happy numbers, Fibonacci Quart., 39(2001), 462–466.

[4] H. G. Grundman and E. A. Teeple, Sequences of consecutive happy numbers, Rocky Mountain J. Math., 37 (2007), 1905–1916

[5] Hao Pan, On consecutive happy numbers, J. Number Theory 128 (2008), 1646–1654.

[6] T. Cai and X. Zhou, On the heights of happy numbers, Rocky Mountain Journal of Mathematics 28, 2008, 1921–1926.

[7] H. G. Grundman and E. A. Teeple, Heights of Happy Numbers and Cubic Happy Numbers. The Fibonacci Quarterly 41 (2003): 301-306

[8] Robert Styer, Smallest Examples of Strings of Consecutive Happy Numbers, Journal of Integer Sequences, Vol. 13 (2010), Article 10.6.3

[9] Shyam Sunder Gupta, Smarandache Sequence of Happy Numbers, Smarandache Notions Journal, Vol. 13 (2002).

[10] Sloane, N. J. A. Sequences A007770, A001273, A035497, A334982, A055629, in "The On-Line Encyclopedia of Integer Sequences."