OFFSET
1,1
COMMENTS
The (3x+1)/2 steps and the halving steps are counted. - Don Reble, May 13 2006
Where records occur in A102419 (could be prefixed by an initial 1). - N. J. A. Sloane, Oct 20 2012
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..35 (from the web page of Tomás Oliveira e Silva)
Tomás Oliveira e Silva, Tables
Eric Roosendaal, On the 3x + 1 problem
N. J. A. Sloane, First 36 terms of A217934 and A060412 [From Roosendaal web site]
EXAMPLE
See A102419.
MATHEMATICA
dcoll[n_]:=Length[NestWhileList[If[EvenQ[#], #/2, 3#+1]&, n, #>=n&]]; t={max=2}; Do[If[(y=dcoll[n])>max, max=y; AppendTo[t, n]], {n, 3, 1130000, 4}]; t (* Jayanta Basu, May 28 2013 *)
PROG
(PARI) first(N) = {my(a=List([2]), r=0); for(i=0, oo, #a<N || break; my(x0=i*4+3, x=x0, p2=0, p3=0, v); until(x<x0, v=valuation(x+1, 2); x=(3^v/2^v*(x+1)-1)/2; p3+=v; p2+=v+1; if(v=valuation(x, 2), x>>=v; p2+=v)); while(x*2<x0, x*=2; p2--); if(x0<2^p2 && r<p3, listput(~a, x0); r=p3)); Vec(a); } \\ Ruud H.G. van Tol, Aug 26 2026
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
N. J. A. Sloane, Apr 06 2001; b-file added Nov 27 2007
STATUS
approved