Happy number

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Hohum (talk | contribs) at 00:43, 2 December 2004 (copyedit, clarity). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Jump to navigation Jump to search

A number is a happy number when the sum of the squares of its digits eventually becomes 1. Numbers that are not happy are called unhappy numbers.

Consider a number t, then define a sequence t0,t1,t2,.. where t0 = t, and ti+1 is the sum of the squares of the digits of ti. t is said to be happy if and only if this sequence is eventually 1, that is for some i, ti = 1.

Thus 7 is happy, as the associated sequence is:

(72) = 49
(42 + 92) = 97
(92 + 72) = 130
(12 + 32) = 10
(12) = 1

A number t is (un)happy iff all members of the above sequence are (un)happy.

The first 20 happy numbers are 1, 7, 10, 13, 19, 23, 28, 31, 32, 44, 49, 68, 70, 79, 82, 86, 91, 94, 97, 100.


External links