OFFSET
1,2
COMMENTS
Let T(n)=n/2 if n is even, (3n+1)/2 if n is odd. This function is the same as the one in the Collatz conjecture, 3x+1 problem, Kakutani's Problem, Syracuse problem etc. Then x is an element of the sequence iff T^k(x) <= x for all k. Several conjectures relating to the 3x+1 problem can be restated in terms of this set. For example: There are no nontrivial cycles iff the <= can be replaced with < in the definition of the sequence for x>2. x has bounded trajectory iff T^k(x) is an element of the sequence for some k. These two statements together are equivalent to the Collatz conjecture.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Douglas J. Shaw, The Pure Numbers Generated by the Collatz Sequence, The Fibonacci Quarterly, Vol. 44, Number 3, August 2006, pp. 194-201.
Eric Weisstein's World of Mathematics, Collatz Problem
Wikipedia, Collatz conjecture
EXAMPLE
1 is a term, because the trajectory stops right there at 1.
2 is a term because the trajectory is 2->1.
3 is not a term because the trajectory is 3 -> 5 -> 8 -> 4 -> 2 -> 1, and 5>3.
MATHEMATICA
L1 = {}; For[i = 1, i < 4096, i++, max = i; n = i; While[n != 1 || Element[n, L1] == False, If[Mod[n, 2] == 1, n = (3 n + 1)/2; If[max <= n, max = n], n = n/2; If[max <= n, max = n]]]; Sort[DeleteDuplicates[L1]]
ctenQ[n_]:=Max[NestWhileList[If[EvenQ[#], #/2, (3#+1)/2]&, n, #>1&]]<=n; Select[Range[200], ctenQ] (* Harvey P. Dale, Mar 17 2017 *)
PROG
(PARI) is(x)=my(X); X=x; while(x!=1, x=if(x%2, (3*x+1)/2, x/2); if(x>X, return(0))); 1
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael Higgins (mikehiggins1981(AT)gmail.com), Oct 10 2009
EXTENSIONS
Edited by Ralf Stephan, Nov 26 2013
Definition clarified by N. J. A. Sloane, Mar 17 2017
STATUS
approved