OFFSET
0,13
COMMENTS
The fixed points are in A061917 (either a palindrome or becomes a palindrome if trailing 0's are omitted). The number of iterations needed to reach a fixed point equals a(n) - 1 with n > 0, and 0 for n = 0.
The smallest k such that a(k) = n iterations are {0, 1, 12, 14, 36, 37, 103, 118, 238, 257, 1282, 2165, 2459, 11908, 100673, 113233, 144104, 300768, 1329025, ...}, and it seems that 3*log_10(k)/n ~ 1 where n tends into infinity.
The Maple program below gives two sequences: the number of iterations of this sequence and the fixed points in increasing order (sequence A061917).
LINKS
Michel Lagneau, Table of n, a(n) for n = 0..10000
EXAMPLE
The trajectory of 37 is 37 -> 36 -> 27 -> 18 -> 9 -> 0, so a(37) = 5. The fixed point is 9 = A061917(10).
73 mod 37 = 36, 63 mod 36 = 27, 72 mod 27 = 18, 81 mod 18 = 9 and 9 mod 9 = 0.
MAPLE
lst1:={}:for n from 1 to 494 do:nn:=n:ii:=0:r:=1:lst:={n}:for it from 1 to 20 while(r<>0) do: V:=convert(nn, base, 10): n1:=nops(V):s:=0:for a from n1 by -1 to 1 do:s:=s+V[a]*10^(n1-a): od:m1:=min(nn, s):m2:=max(nn, s):r:=irem(m2, m1): lst:=lst union {r}:nn:=r: od: printf(`%d, `, it-1): lst1:=lst1 union { lst[2]}: od:print(lst1):
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, May 07 2013
STATUS
approved