OFFSET
1,1
COMMENTS
The Collatz (or 3x+1) function is f(x) = x/2 if x is even, 3x+1 if x is odd. The Collatz trajectory of n is obtained by applying f repeatedly to n until 1 is reached.
REFERENCES
J. Shallit and D. Wilson, The "3x+1" Problem and Finite Automata, Bulletin of the EATCS #46 (1992) pp. 182-185.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
J. Shallit and D. Wilson, The "3x+1" Problem and Finite Automata, Bulletin of the EATCS #46 (1992) pp. 182-185.
MAPLE
b:= proc(n) option remember; irem(n, 2, 'r')+
`if`(n=1, 0, b(`if`(n::odd, 3*n+1, r)))
end:
q:= n-> is(b(n)=11):
select(q, [$1..2000])[]; # Alois P. Heinz, May 18 2022
MATHEMATICA
ocollQ[n_]:=Length[Select[NestWhileList[If[EvenQ[#], #/2, 3#+1]&, n, #>1&], OddQ[#]&]]==11; Select[Range[1140], ocollQ[#]&] (* Jayanta Basu, May 28 2013 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jim Nastos, Jun 19 2002
STATUS
approved