OFFSET
0,3
COMMENTS
When a(x) is iterated, what are the limit cycles? Are there any besides (1) and (17 -> 19 -> 43 -> 97 -> 109 -> 61)?
Up to 1000000000 every number eventually reaches one of those two cycles. In this range, the longest trajectory starts with n=458788881 and takes 193 steps to reach 1. - Christian Boyer (cboyer(AT)club-internet.fr), Sep 16 2006
LINKS
Hugo Pfoertner, Table of n, a(n) for n = 0..10000
MAPLE
A337349 := proc(n)
local a;
a := 3*n+1;
while modp(a, 2) = 0 do
a := a/2 ;
end do:
a := 3*a-1 ;
while modp(a, 2) = 0 do
a := a/2 ;
end do:
a ;
end proc: # R. J. Mathar, Aug 24 2020
MATHEMATICA
a[n_] := Module[{k = 3n+1}, k = k/2^IntegerExponent[k, 2]; k = 3k-1; k = k/2^IntegerExponent[k, 2]; k];
a /@ Range[0, 100] (* Jean-François Alcover, Aug 27 2020 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, based on email from Dan Asimov (dasimov(AT)earthlink.net), Sep 15 2006
STATUS
approved