Every natural number is either 'happy' or 'unhappy' (a trivial name for an interesting property), determined by the following test:

Let dk, dk-1, ... , d2, d1, d0 be the decimal digits of a number n=s0. Let s1 = dk2 + dk-12 + ... + d12 + d02, the sum of the squares of the digits of s0. Similarly, let s2 be the sum of the squares of the digits of s1, and so on. If there exists an i>1 such that si=1, then n=s0, s1, ..., and si-1 are said to be happy numbers. Otherwise, for all i>0, si is said to be an unhappy number. Further, all permutations on the digits of si are just as happy or unhappy as si, since addition is commutative.

For example, 28 is happy because 22+82=4+64=68, 62+82=36+64=100, and 12+02+02=1+0+0=1. The first several happy numbers are 1, 7, 10, 13, 19, 23, 28, ... It is unfortunate that my favorite number, 4, is unhappy. =(

So far, the 'happiness' property of a number is merely interesting, relating only to digital invariance.

Information gleaned from http://mathworld.wolfram.com/HappyNumber.html.

Log in or register to write something here or to contact authors.