Skip to main content

Happy Numbers

Test whether a number is happy and list every happy number up to a limit.

In number theory, a happy number is one that eventually reaches 1 when you repeatedly replace it with the sum of the squares of its digits. A number that never reaches 1 instead falls into a repeating loop and is called sad or unhappy.

Example: 13 → 1² + 3² = 10 → 1² + 0² = 1, so 13 is a happy number.

Check a number

List happy numbers

Calculated in your browser. Limited to 100000 to stay responsive.