Prove that all unhappy/non happy numbers always end up in cyclic sequences of 4

34 Views Asked by At

A happy number is a number which eventually reaches 1 when replaced by the sum of the square of each digit. For instance, 13 is a happy number because 1²+3² = 10 and 1²+0² =1 An example of a non happy number ending with cyclic sequences of 4 would be: 534867

199 -> 163 -> 46 -> 52 -> 29 -> 85 -> 89 -> 145 -> 42 -> 20 -> 4 -> 16 -> 37 -> 58 -> 89 -> 145 -> 42 -> 20 -> 4

I checked this with huge prime numbers using the code in the wikipedia page and it ends in cyclic sequences of 4 with them too. Assuming the conjecture to be true, is there any way to prove that this always hold true other than observation and checking.