A happy number is 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 (or sad numbers).
Read more about Happy Number: Overview, Sequence Behavior, Happy Primes, Special Happy Numbers, Happy Numbers in Other Bases, Cubing The Digits Rather Than Squaring, Origin, Popular Culture, Programming Example
Famous quotes containing the words happy and/or number:
“The secret of success in society, is a certain heartiness and sympathy. A man who is not happy in the company, cannot find any word in his memory that will fit the occasion. All his information is a little impertinent. A man who is happy there, finds in every turn of the conversation equally lucky occasions for the introduction of that which he has to say.”
—Ralph Waldo Emerson (18031882)
“This nightmare occupied some ten pages of manuscript and wound off with a sermon so destructive of all hope to non-Presbyterians that it took the first prize. This composition was considered to be the very finest effort of the evening.... It may be remarked, in passing, that the number of compositions in which the word beauteous was over-fondled, and human experience referred to as lifes page, was up to the usual average.”
—Mark Twain [Samuel Langhorne Clemens] (18351910)