Happy number

from Wikipedia, the free encyclopedia

In number theory in is decimal system a cheerful number (from the English happy number ) is a natural number , the baseline for a particular iteration leads to a finite number of iterations to the value 1, similar to the Collatz Conjecture .

definition

In the case of a natural number with the decimal representation , where and , the individual digits are squared and added, i.e. H. it will

calculated. The resulting number is treated the same way. If at some point the result is 1, then all following numbers also have this value, and the number is said to be happy .

alternative

The only alternative is to transition to the single eight-numbered periodic cycle

There are no other cycles.

Proof:
Be a -digit number. Then the sum of the squares of their individual digits is maximal if and only if the number consists exclusively of him. The sum of the squares of the individual digits is therefore a maximum .
  • Now be a number with at least one digit. Then is with . A single iteration step above then leads to a number (the inequality is true for ). This means that each number leads through each of the above iteration steps to a smaller number that has fewer digits.
  • Be now . The maximum sum of the squares of the individual digits is obtained at and is . This means that every number leads through every single iteration step above to a number for which applies.
  • Be now . The maximum sum of the squares of the individual digits is obtained at and is . This means that every number leads through every single iteration step above to a number for which applies.
  • Be now . The maximum sum of the squares of the individual digits is obtained at and is . This means that every number leads through every single iteration step above to a number for which applies.
  • Be now . The maximum sum of the squares of the individual digits is obtained at and is . This means that every number leads through every single iteration step above to a number for which applies.
In summary, it was shown that each of the above iteration steps leads to a smaller number for each number and ultimately leads to a number . If one examines all of these few numbers , one can see that they are all either happy ( i.e. flowing into ) or ending in the cycle mentioned.

Examples of happy numbers

  • is a happy number:
  • There are 143 happy numbers that are less than or equal to 1000. These 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, ... ( continuation A007770 in OEIS )
  • The first pair of consecutive happy numbers is the pair and . The following list provides information about the smallest additional pairs of consecutive happy numbers that are smaller than 1000 (only the smaller of the two is always given):
31, 129, 192, 262, 301, 319, 367, 391, 565, 622, 637, 655, 912, 931, ... ( continuation A035502 in OEIS )
  • The first triple ( i.e. three tuples ) of consecutive happy numbers is the triple , and . The following list shows the smallest further triples of consecutive happy numbers which are smaller than 10,000 (whereby only the smallest of the three is always given):
1880, 4780, 4870, 7480, 7839, 7840, 8180, 8470, 8739, 8740, 8810, ... (Follow A072494 in OEIS )
  • The following list indicates how many happy numbers there are that are less than or equal to (starting with ):
3, 20, 143, 1442, 14377, 143071, 1418854 , 14255667, 145674808, 1492609148, 15091199357, 149121303586, 1443278000870, 13770853279685, 130,660,965,862,333, 1245219117260664, 12024696404768025, 118226055080025491, 1183229962059381238, 12005034444292997294 ... (sequence A068571 in OEIS )
Example: The 7th position in the list above is the number . So there are a total of different happy numbers, which are smaller or equal .

Properties of happy numbers

  • Not a single number except is the sum of the squares of its own digits.
Proof:
If there were such a number that is at the same time the sum of the squares of its own digits (i.e. ), this number would, if one applied the above iteration steps to it, each time end in itself and thus neither in nor in the only possible one specified above Cycle open. However, it was shown above that only these two cases can occur. So there can be no number that is the sum of the squares of its own digits.
  • There are an infinite number of happy numbers.
Proof:
is a happy number. Applying the above iterations numbers of the form with at, we obtain the sum already the squares of its digits in a single iteration value . Thus, all the numbers of the form are happy. Because there are infinitely many numbers of this form , there are also infinitely many happy numbers.
  • Be any happy number. Then you can get as many more happy numbers as you like by adding or removing any number of zeros, since nothing changes in the sum of the squares of their digits.
  • Let be any natural number. Then there is at least one - tuple of consecutive happy numbers .
Proof: see
Example:
The first value of the smallest - tuples of happy numbers ( i.e. consecutive happy numbers) for ascending are:
1, 31, 1880, 7839, 44488, 7899999999999959999999996, 7899999999999959999999996, ... (sequence A055629 in OEIS )
The fifth position in the list above is the number . Thus all numbers of the er-tuple are happy numbers and it is the smallest possible er-tuple with this property.
  • All numbers in the form or with are happy numbers.
Proof:
Be with (this number starts with the digit , then has zeros and ends with the digit ). The sum of the squares of each digit of that number is . But this number is happy because is. So is happy.
Be with (this number starts with the digit , then has zeros and ends with the digit ). The sum of the squares of each digit of that number is . Applying the above iteration steps to the number , one obtains:
.
So it is also happy.
  • If you swap the digits of a happy number, you get a happy number again.
Proof:
Swapping the digits of a happy number does not change the sum of the squares of its (now swapped) digits. The total stays the same. If the iteration of the original number leads to the number , it also leads to the number now .

Sad (not happy) numbers

A natural number that is not happy is a sad number (or unhappy number ) (from the English unhappy number or sad number ).

Examples of sad (not happy) numbers

  • is a sad (not happy) number:
  • is a sad (not happy) number:
... and you end up in the only possible cycle like in the example directly above.

Properties of sad numbers

  • There are an infinite number of sad numbers.
Proof:
Be with . If you apply the above iterations to numbers of this form, you get the value as the sum of the squares of their digits with a single iteration step and you are at the beginning of the only possible cycle that does not lead to the number (the number is, as in the example previously shown, a sad number). Thus, all the numbers of the form are sad. Because there are infinitely many numbers of this form , there are also infinitely many sad numbers.

Happy prime numbers

A prime that is happy is called a happy prime .

Examples of happy prime numbers

  • The smallest happy prime numbers that are less than or equal to 1000 are the following:
7, 13, 19, 23, 31, 79, 97, 103, 109, 139, 167, 193, 239, 263, 293, 313, 331, 367, 379, 383, 397, 409, 487, 563, 617, 653, 673, 683, 709, 739, 761, 863, 881, 907, 937, ... (sequence A035497 in OEIS ).
  • The Carmichael Number is the product of the first three happy prime numbers.
  • The palindrome prime is a happy prime with digits because the sum of the squares of its digits is equal and is a happy number. Paul Jobling discovered this prime number on December 26, 2005.
  • The currently (as of December 24, 2018) largest known happy prime number is the 46th Mersenne prime number and at the same time the sixth largest known prime number . Applying the above iteration to them one obtains:
It has 12837064 sites and was discovered on June 13, 2009 by Odd Magnar Strindmo. The calculation of the iteration only takes a few seconds with a suitable math program.

Properties of happy prime numbers

  • All prime numbers of the form or with are happy prime numbers.
Proof:
This property results from the above already proven property for happy numbers that all numbers are of the form or with happy numbers.
  • If you swap the digits of a happy prime number, you (in contrast to happy numbers) do not necessarily get a happy prime number again.
Proof:
A counterexample is sufficient: The number is a happy prime number (see list above). If you swap their digits, you get the number that is no longer a prime number. She is happy, but no longer a prime number. ( Specifically, the number is a happy Fermatsche pseudoprime base 3, but that has nothing to do with this problem.)

Happy numbers in other bases

The above definition of cheerful figures based on the decimal system , so the base . This can be generalized:

A number is a happy base number if the sum of the squares of its base digits ends in the number after a finite number of iteration steps .

Examples of happy numbers in other bases

  • The number is a happy base number because the sum of the squares of its digits applies:

Properties of happy numbers in other bases

  • All numbers in the form with are happy numbers on any base .
Proof:
Be with . Then the sum of the squares of their digits is equal and therefore happy.
  • To the base , all the numbers are happy.
Idea of ​​proof:
All binary numbers that are greater than , after multiple iterations, change into a value that is less than or equal . All binary numbers that are less than or equal are happy, as the following calculation shows:
(see example above)
All sequences end in the number , it follows that all numbers in the dual system (i.e. to the base ) are happy. This makes the base a happy base (from happy base ).
  • The only known happy bases are the bases and . There are no other known bases smaller than 500,000,000.
Proof: see
  • In the duodecimal (ie the base ) there are three checkpoints, where above iterations may end: , and (the two numbers and are Armstrong numbers to the base (sequence A161949 in OEIS )). There are also four cycles (where and ):
(in the decimal system , i.e. a cycle of length )
(a cycle of length )
(a cycle of length )
(a cycle of length )
  • In the duodecimal system (i.e. with the base ) there are no happy numbers between and .
  • In the hexadecimal system (ie the base ) there is only one fixed point, to where above iterations end: . There is also only one cycle:
(a cycle of length )
Thus, the situation in the hexadecimal system is similar to that in the decimal system.

Sad numbers in other bases

A sad number in base leads to the above iterations to Cycles of numbers.

Properties of sad numbers in other bases

  • After the above iterations, a sad number at the base leads to a cycle of numbers which (with arguments analogous to the above) are all smaller than . If is, then the sum of the squares of their base digits is less than or equal to (what is for ). This shows that if an iteration reaches a number smaller than , it always remains below for the rest of the sequence and thus has to transition into either a cycle or the number (in the first case it is sad, in the second case it is happy).

Generalization of happy and unhappy numbers

One can expand the definition of happy numbers by not looking at the sum of the squares of the individual digits of a number , but the -th powers of the individual digits of a number . The basis in this section is always the decimal system.

Examples of generalized happy and unhappy numbers

  • The number is a generalized happy number for because:
In short:
  • The number is a generalized non-happy number for because:
In short:
Thus, the number gets "stuck" after just three iterations and then stays with the number as a constant . Because it does not flow into the , it is not a generalized happy number, but a generalized non-happy number.

Properties of generalized happy and unhappy numbers

  • Let (you consider the sum of the 3rd powers of the individual digits of a number ). If you cube the individual digits of a number and add them up, you get the sum for which applies:
(If the digits are not cubed, but only squared as originally, this statement applies to and was dealt with at the beginning of this article.)
Proof:
Be a -digit number. Then the sum of the 3rd powers of its individual digits is maximum precisely when the number consists exclusively of it. The sum of the 3rd powers of the individual digits is therefore a maximum .
  • Now be a number with at least one digit. Then is with . A single iteration step above then leads to a number (the inequality is true for ). This means that each number leads through each of the above iteration steps to a smaller number that has fewer digits.
  • Be now . The maximum sum of the squares of the individual digits is obtained at and is . This means that every number leads through every single iteration step above to a number for which applies.
  • Let (you consider the sum of the 3rd powers of the individual digits of a number ). Then generalized unlucky numbers either result in one of the following constants:
or or or
or in one of the following four cycles:
(Cycle of length )
(Cycle of length )
(Cycle of length )
(Cycle of length )
Proof:
Because of the previous feature, you only have to check all the numbers up to , which a not particularly fast computer is sufficient. It can be seen that generalized unhappy numbers flow into one of the eight possibilities above.
The following applies to the first four constants:
actually results in a constant that turns into itself during iteration.
also actually results in a constant which is transformed into itself during iteration.
also actually results in a constant which is transformed into itself during iteration.
also actually results in a constant which is transformed into itself during iteration.
The following applies to the other four cycles:
gives a cycle of length .
also gives a cycle of length .
gives a cycle of length .
gives a cycle of length .
  • The only numbers that are equal to the sum of the 3rd powers of their digits are the following numbers:
0, 1, 153, 370, 371, 407 (sequence A046197 in OEIS )
Proof:
If there were other numbers with this property, there would be other variants of the previous property that generalized non-happy numbers lead to special constants. The previous property only specifies the constants and . The two numbers and trivially have this property.
  • Let (so consider the sum of the 4th powers of the individual digits of a number ). Then generalized unlucky numbers either result in one of the following constants:
or or
or in one of the following two cycles:
(Cycle of length )
(Cycle of length )
Proof:
The numbers between 1 and 100 can be checked quickly with a computer and you can actually see that they lead to the following numbers or cycles:
actually results in a constant that turns into itself during iteration.
also results in a constant which is transformed into itself during iteration.
also results in a constant which is transformed into itself during iteration.
gives a cycle of length .
gives a cycle of length .

See also

Web links

Individual evidence

  1. ^ Hao Pan : On consecutive happy numbers. (PDF) Cornell University , 2006, pp. 1–8 , accessed December 9, 2018 .
  2. Chris K. Caldwell: 10 150006 + 7426247 · 10 75000 + 1. The Largest Known Primes, accessed December 9, 2018 .
  3. List of the largest known prime numbers (English). Retrieved December 24, 2018 .
  4. Chris K. Caldwell: 2 42643801 - 1. The Largest Known Primes, accessed December 14, 2018 .
  5. NJA Sloane : Smallest unhappy number in base n (or 0 if no unhappy numbers in the base) - Comments. OEIS , accessed December 9, 2018 .