OFFSET
1,2
COMMENTS
If the Collatz conjecture is true, there are no cycles in the 3x+1 trajectory and the difference between the counts here and those of A076228 is that the start value is counted here but not there; then a(n) = 1+A076228(n) [discovered by sequencedb.net]. - R. J. Mathar, Jun 24 2021
LINKS
FORMULA
EXAMPLE
a(9) = #{1,2,4,5,7,8,9} = 7, as
9-28-14-7-22-11-34-17-52-26-13-40-20-10-5-16-8-[4-2-1]*
9-..-..-7-..-..-..-..-..-..-..-..-..-..-5-..-8-[4-2-1]*.
MAPLE
b:= proc(n, m) option remember; `if`(n<=m, 1, 0)+
`if`(n=1, 0, b(`if`(n::even, n/2, 3*n+1), m))
end:
a:= n-> b(n$2):
seq(a(n), n=1..72); # Alois P. Heinz, Dec 02 2025
MATHEMATICA
Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; f[n_] := Module[{c = Collatz[n]}, Length[Select[c, # <= n &]]]; Table[ f[n], {n, 100}] (* T. D. Noe, Mar 07 2013 *)
PROG
(Haskell)
a159999 n = length $ takeWhile (<= n) $ sort $ a070165_row n
-- Reinhard Zumkeller, Sep 01 2012
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Reinhard Zumkeller, May 04 2009
STATUS
approved
