Happy Number - Sequence Behavior

Sequence Behavior

If n is not happy, then its sequence does not go to 1. What happens instead is that it ends up in the cycle

4, 16, 37, 58, 89, 145, 42, 20, 4, ...

To see this fact, first note that if n has m digits, then the sum of the squares of its digits is at most, or .

For and above,

so any number over 1000 gets smaller under this process and in particular becomes a number with strictly fewer digits. Once we are under 1000, the number for which the sum of squares of digits is largest is 999, and the result is 3 times 81, that is, 243.

  • In the range 100 to 243, the number 199 produces the largest next value, of 163.
  • In the range 100 to 163, the number 159 produces the largest next value, of 107.
  • In the range 100 to 107, the number 107 produces the largest next value, of 50.

Considering more precisely the intervals, and, we see that every number above 99 gets strictly smaller under this process. Thus, no matter what number we start with, we eventually drop below 100. An exhaustive search then shows that every number in the interval either is happy or goes to the above cycle.

The above work produces the interesting result that no positive integer other than 1 is the sum of the squares of its own digits, since any such number would be a fixed point of the described process.

There are infinitely many happy numbers and infinitely many unhappy numbers. As an informal proof, consider the following:

  • For any happy number, every number in its sequence is happy. Likewise for unhappy numbers.
  • For this reason, to come up with a new happy number, it is sufficient to find a number such that the sum of the squares of its digits is itself a happy number. Likewise, to find a new unhappy number, one can simply find a number such that the sum of the squares of its digits leads to an unhappy number.
  • It is easy to generate a number that leads (in this sequence) to a known happy or unhappy number. For example, if one wonders if any number will produce 14,308, say, the quick response is to write down the digit "1" 14,308 times and you have created such a number.
  • Infinitely many such numbers exist, since zeros can be inserted at will.

The first pair of consecutive happy numbers is 31, 32. The first set of triplets is 1880, 1881, and 1882.

An interesting question is to wonder about the density of happy numbers. In the interval, 15.5% (to three significant figures) are happy.(sequence A068571 in OEIS)

Read more about this topic:  Happy Number

Famous quotes containing the words sequence and/or behavior:

    Reminiscences, even extensive ones, do not always amount to an autobiography.... For autobiography has to do with time, with sequence and what makes up the continuous flow of life. Here, I am talking of a space, of moments and discontinuities. For even if months and years appear here, it is in the form they have in the moment of recollection. This strange form—it may be called fleeting or eternal—is in neither case the stuff that life is made of.
    Walter Benjamin (1892–1940)

    He is not a true man of science who does not bring some sympathy to his studies, and expect to learn something by behavior as well as by application. It is childish to rest in the discovery of mere coincidences, or of partial and extraneous laws. The study of geometry is a petty and idle exercise of the mind, if it is applied to no larger system than the starry one.
    Henry David Thoreau (1817–1862)