Happy Number Checker

Sum of digit squares → 1?

CalculatorsFreeNo Signup
4.4(857 reviews)
All Tools

Loading tool...

About Happy Number Checker

A happy number checker that iterates the digit-square sum process. A number is happy if the sequence reaches 1, unhappy if it enters the cycle 4→16→37→58→89→145→42→20→4. Shows full sequence and cycle detection. All calculations are client-side.

Happy Number Checker Features

  • Happy check
  • Sequence
  • Cycle detection
  • Range scan
  • Base support
Happy number: repeatedly replace n with sum of squares of its digits. If reaching 1, happy. Otherwise enters cycle 4→16→37→58→89→145→42→20→4. First few happy: 1,7,10,13,19,23,28,31. About 14.3% of positive integers are happy.

How to Use

Enter n:

  • Happy: Sequence reaches 1
  • Unhappy: Enters cycle
  • Sequence: Full iteration

Properties

  • Permutations of happy numbers are happy
  • Adding zeros doesn't change happiness
  • Happy primes: 7,13,19,23,31,79,97...
  • The only cycle for unhappy is length 8

Other Bases

Happiness depends on the base. In base 2, the only happy number is 1. In base 3, happy numbers include 1,10. The concept extends to any base b≥2.

Step-by-Step Instructions

  1. 1Enter n.
  2. 2Check happy/unhappy.
  3. 3View sequence.
  4. 4See cycle.
  5. 5Scan range.

Happy Number Checker — Frequently Asked Questions

Why is there only one cycle for unhappy numbers?+

For any n with d digits in base 10, the digit-square sum is at most 81d. For n>1000, 81d < n, so the sequence eventually drops below 1000. Below 1000, every unhappy number eventually enters the unique cycle 4→16→37→58→89→145→42→20→4.

What fraction of numbers are happy?+

The density of happy numbers is approximately 14.3%. The happy numbers have a natural density, meaning the proportion stabilizes as n→∞. In any block of 10 consecutive numbers starting with a multiple of 10, typically 1-2 are happy.

What are happy primes?+

Primes that are also happy: 7, 13, 19, 23, 31, 79, 97, 103, 109, 139, ... There are infinitely many happy primes. They combine two interesting properties and are used in recreational math puzzles.

Share this tool: