A happy number is a number 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. 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 the sequence are unhappy.
Especially, the happiness of a number is unaffected by rearranging the digits, and by inserting or removing any number of zeros anywhere in the number. For example, 19 is happy, as the associated sequence is:
1^2 + 9^2 = 82
8^2 + 2^2 = 68
6^2 + 8^2 = 100
1^2 + 0^2 + 0^2 = 1.
There are infinitely many happy numbers and infinitely many unhappy numbers. Consider the following proof: 1 is a happy number, and for every n, 10n is happy since its sum is 1, and for every n, 2 × 10n is unhappy since its sum is 4 and 4 is an unhappy number.
Maybe, “Happy Number” is a relative concept, but definitely they are interesting numbers.
See more: Happy numbers and Happy primes at Wikipedia - Image: One by Paul Thurlby.