Happy

Square the digits, again and again, until you land on 1.

A number that eventually reaches 1 when you repeatedly replace it with the sum of the squares of its digits. E.g. 19: 82 → 68 → 100 → 1. Numbers that never reach 1 are unhappy.

143,071
Exact matches
1 in 7
Odds
14.31%
Share
56 EP
Base EP

Your record

Not unlocked yet — roll today's number →

Happy numbers make up 14.31% of the range (143,071 of them) — about one hit per 7 rolls. Digit length barely matters: two-digit and six-digit numbers are happy at nearly the same ~15% rate, like a natural constant. Happy numbers are indeed known to have positive density among the naturals, though no exact formula for that density exists.

Every unhappy number shares the same fate: all of them fall into one cycle — 4→16→37→58→89→145→42→20→4. So the million numbers in this game have exactly two destinies: reach 1, or spin forever in this 8-number loop. Spotting a 4 is all the detector needs, which is why the check runs in constant loop-bounded time.

Trivia: 1,000,000 itself is happy (1² plus six 0² equals 1, one step and done); 7 is the smallest happy prime. Whether infinitely many happy primes exist is a famous open problem.

Smallest examples

Notable examples

1,000,000 The ceiling of the range is happy: one step straight to 1 — the fastest in a million.
7 The smallest happy prime. 7→49→97→130→10→1, five steps home.

Related Entries

← Number Atlas