OFFSET
1,1
COMMENTS
Recall that f(k) = k/2 if k is even, 3k + 1 if k is odd (A006370).
LINKS
Eric M. Schmidt, Table of n, a(n) for n = 1..10000
Marcus Elia and Amanda Tucker, Consecutive Integers and the Collatz Conjecture, arXiv:1511.09141 [math.NT], 2015.
Lynn E. Garner, On heights in the Collatz 3n+1 problem, Discrete Math, 55 (1985), 57-64.
Eric Weisstein's World of Mathematics, Collatz Problem
Wikipedia, Collatz Conjecture
EXAMPLE
The Collatz trajectories k, f(k), f(f(k)), ..., 1 for k = 12 and 13, respectively, are {12, 6, 3, 10, 5, 16, 8, 4, 2, 1} and {13, 40, 20, 10, 5, 16, 8, 4, 2, 1}, which are both of length 10. Hence h(12) = h(13) = 10, so 12 belongs to this sequence.
MAPLE
collatz:= proc(n) option remember; `if`(n=1, 0,
1 + collatz(`if`(n::even, n/2, 3*n+1)))
end:
q:= n-> is(collatz(n)=collatz(n+1)):
select(q, [$1..200])[]; # Alois P. Heinz, Jul 19 2023
MATHEMATICA
h[n_] := Length@NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &];
okQ[n_] := h[n] == h[n+1];
Select[Range[200], okQ] (* Jean-François Alcover, Jan 12 2024 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Joseph L. Pe, Dec 29 2002
STATUS
approved