Happy numbers are defined by an iterative digit-square-sum process that either reaches 1 (happy) or enters a specific 8-number cycle (unhappy). The concept was popularized by mathematician Arthur Porges in 1945.
⚠All unhappy numbers eventually enter the 4-16-37-58-89-145-42-20 cycle. This is proven for all positive integers.
What Is a Happy Number?
A happy number is a positive integer that reaches 1 when repeatedly replacing it with the sum of squares of its digits. If it enters the unhappy cycle instead, it is called an unhappy or sad number. About one in seven numbers is happy.
Happy Process
Sum squares of digits, replace, repeat. 19: 1+81=82, 64+4=68, 36+64=100, 1+0+0=1. Happy! Reaches 1.
Unhappy Cycle
Numbers like 2, 3, 4, 5 enter a cycle: 4->16->37->58->89->145->42->20->4. They never reach 1.
Prime Happy
Happy primes are happy numbers that are also prime: 7, 13, 19, 23, 31, 79, 97, 103, 109, 139, 167, 193, 239...
Infinity
There are infinitely many happy numbers. The asymptotic density is about 0.144. For n-digit numbers, ~14.4% are happy.
Teaching Example: n=19. 1^2+9^2=1+81=82. 8^2+2^2=64+4=68. 6^2+8^2=36+64=100. 1^2+0^2+0^2=1. Reached 1 in 4 steps! 19 is happy. Try 4: 4^2=16, 1+36=37, 9+49=58, 25+64=89, 64+81=145, 1+16+25=42, 16+4=20, 4+0=4. Cycle! 4 is unhappy.
Free online calculators and tools covering mathematics, unit conversion, text processing, and daily life. Accurate, fast, mobile-friendly, and completely free to use.