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:
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):
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):
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:
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.
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:
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.