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”).

A308006
Iterate the map x->A308005(x) starting at x=n; a(n) is the number of steps before the first repeated term is encountered.
1
3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 0, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1
OFFSET
0,1
LINKS
EXAMPLE
0 -> 11 -> 220 -> 33 -> 220 -> ... and a number is repeated at step 4, so a(0)=3.
1 -> 110 -> 231 -> 231 -> 231 -> ..., so a(1) = 2.
22 -> 22 -> 22 -> ... is a fixed point, so a(22) = 0.
MAPLE
# using Maple procedure A308006 from that sequence
f:= proc(n) local t, S, i;
S:= {n};
t:= n;
do
t:= A308005(t);
if member(t, S) then return nops(S)-1 fi;
S:= S union {t};
od
end proc:
map(f, [$0..100]); # Robert Israel, May 14 2019
CROSSREFS
Cf. A308005.
Sequence in context: A097509 A095206 A344129 * A049071 A168330 A176059
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, May 12 2019
STATUS
approved