OFFSET
0,1
COMMENTS
For n<40 the sequences reach 1, for n=40 the sequence reaches 1163 for x(889) and recover 1163 for x(889+931) a cycle of 961 values.
EXAMPLE
For n=1 after 135 tripling(+1), 47 doubling(+1) and 263 halfing x(446)=1, so a(1)=446.
PROG
(PARI) f(x) = if (x % 2, if (isprime(x), 2*x+1, 3*x+1), x/2);
a(n) = {x = f(2*n+1); nb = 2; while (! ((x == 1) || (x == 1163)), x = f(x); nb++); nb; } \\ Michel Marcus, Mar 07 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Mar 07 2018
STATUS
approved