Happy Numbers
A happy number or unhappy number may be determined by the following process:
1) Beginning with any positive integer, replace the number by the sum of the squares of its digits,
2) Repeat the process until the number equals one (where it will remain) or it loops endlessly in a cycle which does not include one.
Those numbers for which this process ends in one are happy numbers, while those that do not end in one are unhappy numbers.
Various happy numbers include:
- 1
- 7
- 10
- 13
- 19
- 23
- 28
- 31
- 32
- 44
Happy Primes:
A happy number of a prime is referred to as a happy prime. Various happy primes include:
- 7
- 13
- 19
- 23
- 31
- 79
- 97
- 103
- 109
Example:
Solution:
72 = 49
42 + 92 = 97
92 + 72 = 130
12 + 32 + 02 = 10
12 + 02 = 1
Since process terminated with one and 7 is both prime and happy, it follows that the number is a happy prime.
Show 7 is a happy prime.
Solution:
72 = 49
42 + 92 = 97
92 + 72 = 130
12 + 32 + 02 = 10
12 + 02 = 1
Since process terminated with one and 7 is both prime and happy, it follows that the number is a happy prime.