Thursday, November 10, 2011

Happy Numbers


A happy number is as follows. Starting with any positive integer, replace that number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or until you determine that 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.
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




No comments:

Post a Comment