Happy number

Happy number

A happy number is defined by the following process. Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1. Those numbers for which this process ends in 1 are happy numbers, while those that do not end in 1 are unhappy numbers.

Overview

More formally, given a number n=n_0, define a sequence n_1, n_2, ... where n_{i+1} is the sum of the squares of the digits of n_i. Then n is happy if and only if there exists "i" such that n_i = 1.

If a number is happy, then all members of its sequence are happy; if a number is unhappy, all members of its sequence are unhappy.

For example, 7 is happy, as the associated sequence is::72 = 49:42 + 92 = 97:92 + 72 = 130:12 + 32 + 02 = 10:12 + 02 = 1.

The happy numbers below 500 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. OEIS|id=A007770.

equence 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 81m. For m=4 and above,:ngeq10^{m-1}>81mso any number over 1000 gets smaller under this process. 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 [244,999] , [164,243] , [108,163] and [100,107] , 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 [1,99] is either happy or goes to the above cycle.

Happy primes

A happy prime is a happy number that is prime. The happy primes below 500 are

7, 13, 19, 23, 31, 79, 97, 103, 109, 139, 167, 193, 239, 263, 293, 313, 331, 367, 379, 383, 397, 409, 487 OEIS|id=A035497.
All numbers, and therefore all primes, of the form 10^n + 3 and 10^n + 9 are happy. To see this, note that these numbers yield values of either 12 + 02 + 02 + ... + 02 + 02 + 32 = 10 → 12 + 02 = 1 or 12 + 02 + 02 + ... + 02 + 02 + 92 = 82 → 82 + 22 = 68 → 62 + 82 = 100 → 12 + 02 + 02 = 1.

The palindromic prime 10150006 + 7426247×1075000 + 1 is also a happy prime with 150007 digits because the many 0's do not contribute to the sum of squared digits, and 1^2 + 7^2+4^2+2^2+6^2+2^2+4^2+7^2 + 1^2 = 176, which is a happy number. Paul Jobling discovered the prime in 2005. [ [http://primes.utm.edu/primes/page.php?id=76550 The Prime Database: 10^150006+7426247*10^75000+1 ] ] .

As of June 2007, the largest known happy prime and the twelfth largest known prime is 4847 × 23321063 + 1. The decimal expansion has 999744 digits: 1844857508...(999724 digits omitted)...2886501377. Richard Hassler and Seventeen or Bust discovered the prime in 2005. [ [http://primes.utm.edu/primes/page.php?id=75994 The Prime Database: 4847*2^3321063+1 ] ] [http://www.seventeenorbust.com/documents/prime-101205.txt] Jens K. Andersen identified it as the largest known happy prime in June 2007.

Happy numbers in other bases

The definition of happy numbers depends on the decimal (i.e., base 10) representation of the numbers. The definition can be extended to other bases.

To represent numbers in other bases, we may use a subscript to the right to indicate the base. For instance, 100_2 represents the number 4, and :123_5 = 1 cdot 5^2 + 2 cdot 5 + 3 =38.Then, it is easy to see that there are happy numbers in every base. For instance, the numbers:1_b,10_b,100_b,1000_b,...are all happy, for any base b.

By a similar argument to the one above for decimal happy numbers, we can see that unhappy numbers in base b lead to cycles of numbers less than 1000_b. We can use the fact that if n < 1000_b, then the sum of the squares of the base-b digits of n is less than or equal to:3(b-1)^2which can be shown to be less than b^3. This shows that once the sequence reaches a number less than 1000_b, it stays below 1000_b, and hence must cycle or reach 1.

In base 2, all numbers are happy. All binary numbers larger than 10002 decay into a value equal to or less than 10002, and all such values are happy:The following four sequences contain all numbers less than 1000_2:: 111_2 ightarrow 11_2 ightarrow 10_2 ightarrow 1 : 110_2 ightarrow 10_2 ightarrow 1 : 101_2 ightarrow 10_2 ightarrow 1 : 100_2 ightarrow 1. Since all sequences end in 1, we conclude that all numbers are happy in base 2. This makes base 2 a happy base.

The only happy bases strictly less than 247 are 2 and 4, yet more could exist outside this range. Fact|date=July 2008

Origin

Happy numbers were brought to the attention of Reg Allenby [http://www.maths.leeds.ac.uk/pure/staff/allenby/allenby.html] , a British author and Senior Lecturer in pure mathematics at Leeds University, by his daughter. She had learned of them at school, but they "may have originated in Russia" harvcol|Guy|2004|p=§E34.

Popular culture

In the "Doctor Who" episode "42", a sequence of happy primes (313, 331, 367, 379) is used as a code for unlocking a sealed door on a spaceship about to collide with a sun.

Notes

References

*Walter Schneider, [http://web.archive.org/web/20060204094653/http://www.wschnei.de/digit-related-numbers/happy-numbers.html Mathews: Happy Numbers] .
*MathWorld|urlname=HappyNumber|title=Happy Number
* [http://mathforum.org/library/drmath/view/55856.html Happy Numbers] at The Math Forum.

*citation
surname1 = Guy
given1 = Richard
authorlink1 = Richard Guy
year = 2004
title = Unsolved Problems in Number Theory (third edition)
publisher = Springer-Verlag
id=ISBN 0-387-20860-7


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • Happy Valley, Hong Kong — Happy Valley (zh t|t=快活谷; more popular form: 跑馬地, lit. horse racing ground, former name: 愉園) is a mostly residential suburb of Hong Kong, located in the north of Hong Kong Island. It is one of the early communities of Hong Kong. Administratively …   Wikipedia

  • Happy Days (play) — Happy Days is a play in two acts, written in English, by Samuel Beckett. He began the play on 8th October 1960 [Knowlson, J., Damned to Fame: The Life of Samuel Beckett (London: Bloomsbury, 1996), p 475] and it was completed on 14th May 1961.… …   Wikipedia

  • Happy Christmas (Jessica Simpson album) — Happy Christmas Studio album by Jessica Simpson Released November 22 …   Wikipedia

  • Happy Birthday to You — also known more simply as Happy Birthday , is a traditional song that is sung to celebrate the anniversary of a person s birth. According to the 1998 Guinness Book of World Records , Happy Birthday to You is the most well recognized song in the …   Wikipedia

  • Happy 15 — Single par THE Possible extrait de l’album Kyūkyoku no The Possible Best Number Shō 1 Face A Happy 15 Face B Washoku Bijin Sortie 7 novembre 2007 …   Wikipédia en Français

  • Number Two (The Prisoner) — Number Two was the title of the chief administrator[1] of The Village in the 1967 68 British television series The Prisoner. More than 17 different actors appeared as holders of the office during the 17 episode series (some episodes featured more …   Wikipedia

  • Happy Birthday, Mr. President — was a song sung by actress/singer Marilyn Monroe on May 19, 1962 for then President of the United States, John F. Kennedy, at a celebration for his forty fifth birthday. Sung in a sultry voice, Monroe sang the traditional Happy Birthday to You… …   Wikipedia

  • Number One (R. Kelly song) — Number One Single by R. Kelly featuring Keri Hilson from the album Untitled …   Wikipedia

  • Number One (Alexia song) — Number One Single by Alexia from the album Fan Club Released 1996 (Italy) Format …   Wikipedia

  • Number Six (The Prisoner) — Number Six is the central fictional character in the 1960s television series The Prisoner, played by Patrick McGoohan. In the AMC remake, the character is played by Jim Caviezel, renamed Six . In several episodes, his attempts to escape his… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”