A364682 Number of iterations of the "x -> sum of squares of digits of x" map (A003132) for n to converge to either 0, 1 or the 8-cycle (37,58,89,145,42,20,4,16).
1, 1, 2, 6, 1, 5, 10, 6, 6, 5, 2, 3, 6, 3, 7, 4, 1, 6, 4, 5, 1, 6, 7, 4, 2, 4, 3, 7, 4, 3, 6, 3, 4, 5, 5, 6, 9, 1, 3, 6, 2, 7, 1, 5, 5, 8, 5, 4, 7, 5, 5, 4, 4, 6, 8, 6, 3, 5, 1, 3, 10, 2, 3, 9, 5, 3, 8, 3, 3, 6, 6, 6, 7, 2, 4, 5, 3, 3, 5, 4, 6, 4, 4, 3, 7, 2
Offset: 0
Keywords
Links
- Chai Wah Wu, Table of n, a(n) for n = 0..10000
Programs
-
Python
def A364682(n): c = 1 while n not in {0,1,37,58,89,145,42,20,4,16}: n = sum((0, 1, 4, 9, 16, 25, 36, 49, 64, 81)[ord(d)-48] for d in str(n)) c += 1 return c
Comments