OFFSET
1,2
COMMENTS
In this variation of the Collatz function, f(x) = x/2 if x is even, 3x + 5 if x is odd.
f(a(n)) will end in the loop 8, 4, 2, 1.
For any odd number n in the sequence, n*2^x where x is a positive integer will also be in the sequence.
EXAMPLE
For n = 53, the numbers produced are 53 -> 164 -> 82 -> 41 -> 128 -> 64 -> 32 -> 16 -> 8 -> 4 -> 2 -> 1 -> 8 -> 4 -> 2 -> 1 -> ...
MATHEMATICA
Select[Range@ 400, Function[n, NestWhile[If[EvenQ@ #, #/2, 3 # + 5] &, n, And[FreeQ[{##}, 1], Count[{##}, n] <= 2] &, All, 120] == 1]] (* Michael De Vlieger, Dec 27 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Cara Bennett, Dec 27 2019
STATUS
approved