login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A118739
Let L_n be the infinite sequence formed by starting with 1 and repeatedly placing the first digit at the end of the number and adding n to get the next term. If L_n eventually reaches a cycle, sequence gives length of that cycle, otherwise -1.
2
9, 9, 3, 9, 18, 3, 18, 9, 1, 18, 9, 6, 9, 18, 6, 18, 9, 1, 18, 36, 9, 18, 18, 9, 18, 9, 3, 18, 36, 9, 18, 27, 3, 18, 9, 3, 45, 36, 6, 9, 27, 12, 27, 18, 3, 72, 36, 9, 9, 27, 9, 27, 18, 3, 99, 27, 9, 45, 27, 9, 27, 18, 3, 27, 27, 9, 45, 27, 9, 27, 18, 3, 27, 27, 9, 54, 27, 9, 27, 36, 3, 27
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
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
Sequence in context: A180012 A172504 A172502 * A192031 A283749 A249023
KEYWORD
base,nonn
AUTHOR
Luc Stevens (lms022(AT)yahoo.com), May 24 2006
EXTENSIONS
Corrected by Robert Israel, Dec 25 2017
STATUS
approved