UNHAPPY NUMBERS

10 days ago
71

unhappy numbers

An unhappy number is a positive integer that is not happy. That is, the sequence of operations does not end in 1, but rather remains in a cycle. Some examples of unhappy numbers are:

- 4: 4 → 16 → 37 → 58 → 89 → 145 → 42 → 20 → 4 (cycle)
- 6: 6 → 36 → 45 → 41 → 17 → 50 → 25 → 29 → 85 → 89 → 145 → 42 → 20 → 4 → 16 → 37 → 58 → 89 → 145 → 42 → 20 → 4 (cycle)

Loading comments...