Concept

Happy number

Summary
In number theory, a happy number is a number which eventually reaches 1 when replaced by the sum of the square of each digit. For instance, 13 is a happy number because , and . On the other hand, 4 is not a happy number because the sequence starting with and eventually reaches , the number that started the sequence, and so the process continues in an infinite cycle without ever reaching 1. A number which is not happy is called sad or unhappy. More generally, a -happy number is a natural number in a given number base that eventually reaches 1 when iterated over the perfect digital invariant function for . The origin of happy numbers is not clear. Happy numbers were brought to the attention of Reg Allenby (a British author and senior lecturer in pure mathematics at Leeds University) by his daughter, who had learned of them at school. However, they "may have originated in Russia" . Perfect digital invariant Formally, let be a natural number. Given the perfect digital invariant function for base , a number is -happy if there exists a such that , where represents the -th iteration of , and -unhappy otherwise. If a number is a nontrivial perfect digital invariant of , then it is -unhappy. For example, 19 is 10-happy, as For example, 347 is 6-happy, as There are infinitely many -happy numbers, as 1 is a -happy number, and for every , ( in base ) is -happy, since its sum is 1. The happiness of a number is preserved by removing or inserting zeroes at will, since they do not contribute to the cross sum. By inspection of the first million or so 10-happy numbers, it appears that they have a natural density of around 0.15. Perhaps surprisingly, then, the 10-happy numbers do not have an asymptotic density. The upper density of the happy numbers is greater than 0.18577, and the lower density is less than 0.1138. A happy base is a number base where every number is -happy. The only happy integer bases less than 5e8 are base 2 and base 4. For , the only positive perfect digital invariant for is the trivial perfect digital invariant 1, and there are no other cycles.
About this result
This page is automatically generated and may contain information that is not correct, complete, up-to-date, or relevant to your search query. The same applies to every other page on this website. Please make sure to verify the information with EPFL's official sources.