OFFSET
1,1
COMMENTS
It is conjectured that L_n always reaches a cycle.
From Robert Israel, Dec 26 2017: (Start)
It always reaches a cycle. Suppose d = A055642(n).
If L_n(k) < 10^(d+1) + 10^d, then L_n(k+1) < 10^(d+1) + n < 10^(d+1) + 10^d. Thus the sequence L_n is bounded, and always reaches a cycle.
Moreover, a(n) <= 11*10^A055642(n). (End)
From Robert Israel, Dec 25 2017: (Start)
a(10^k-1) = 1 for k >= 1.
a(19*10^k-1) = 1.
Empirical:
a(10^k) = 9*(k+1).
a(2*10^k) = 9*(k+1)^2.
a(2*10^k-1) = 9*(k+1).
a(10^k+1) = 9*(k+1) for k >= 2.
a(2*10^k+1) = 3*(k+2) for k >= 1. (End)
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
L_5 = [1,6,11,16,66,71,22,27,77,82,33,38,88,93,44,49,99,104,46,69,101,16,...]
enters a cycle of length 18 after 3 steps.
MAPLE
h:= proc(n) local t, k, S, d;
t:= 1; S[t]:= 0;
for k from 1 do
d:= 10^ilog10(t);
t:= 10*(t mod d)+ floor(t/d) + n;
if assigned(S[t]) then return k-S[t] fi;
S[t]:= k;
od
end proc:
map(h, [$1..100]); # Robert Israel, Dec 25 2017
MATHEMATICA
h[n_] := Module[{t, k, S, d}, t = 1; S[_] = 0; For[k = 1, True, k++, d = 10^Floor[Log[10, t]]; t = 10*Mod[t, d] + Floor[t/d] + n; If[S[t] != 0, Return[k - S[t]]]; S[t] = k]];
Array[h, 100] (* Jean-François Alcover, Dec 26 2017, after Robert Israel *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Luc Stevens (lms022(AT)yahoo.com), May 24 2006
EXTENSIONS
Corrected by Robert Israel, Dec 25 2017
STATUS
approved