A178049 The number of iterations of the map x -> x + d(x) to reach a repdigit (cf. A010785), starting at n, where the decimals of d(x) are the first differences of the decimals of x.
2, 1, 7, 6, 7, 5, 3, 6, 8, 4, 2, 2, 1, 5, 4, 7, 3, 3, 6, 8, 2, 2, 2, 1, 5, 4, 7, 3, 3, 6, 2, 2, 2, 2, 1, 5, 4, 3, 3, 3, 2, 2, 2, 2, 2, 1, 5, 4, 3, 3, 2, 2, 2, 2, 2, 2, 1, 4, 3, 3, 2, 2, 2, 2, 2, 2, 2, 1, 4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, 2, 2, 2, 2, 2, 2, 2
Offset: 10
Examples
a(11) = 1 because 11 + (1-1) = 11 + 0, and 0 is obtained after the first iteration. a(12) = 7 because 12 + 1 = 13 -> 13 + 2 = 15 -> 15 + 4= 19 -> 19 + 8 = 27-> 27 + 5 = 32 -> 32 + 1 = 33 -> 33 + 0 = 33 is the last number of the cycle, and 0 is obtained after the 7th iteration.
Links
- Michel Lagneau, Table of n, a(n) for n = 10..10000
Crossrefs
Cf. A010785.
Programs
-
Maple
for n from 10 to 200 do:n0:=n:s:=1:for i from 1 to 10^6 while(s<>0) do:x:=convert(n0,base,10):n1:=nops(x):s:=sum(abs(x[j+1]-x[j]),j=1..n1-1):n0:=n0+s:it:=i:od: printf(`%d, `, it):od:
Comments