OFFSET
1,2
COMMENTS
This sequence has density zero.
To illustrate the density: there are 2011 terms up to 10^4, 14878 terms up to 10^5, 117671 terms up to 10^6, 913314 terms up to 10^7, 7176461 terms up to 10^8, 56591334 terms up to 10^9, and 445290307 terms up to 10^10. - Charles R Greathouse IV, Jul 09 2017
There are 3560822110 terms up to 10^11, 27907016447 terms up to 10^12, 223533750957 terms up to 10^13, 1772572144707 terms up to 10^14, ..., roughly 7.952916868743154^m/log(10) terms up to 10^m. - Yi Yang, Aug 29 2017
REFERENCES
J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010. See pp. 6, 280.
LINKS
MATHEMATICA
terms = 69; Clear[f]; f[n_] := f[n] = With[{lst = NestList[{2 # + 1, 3 # + 1, 6 # + 1}&, 1, n] // Flatten // Union}, If[Length[lst] <= terms, lst, Take[lst, terms]]]; f[1]; f[n = 2]; While[f[n] != f[n-1], Print["n = ", n]; n++]; A185661 = f[n] (* Jean-François Alcover, May 17 2017 *)
PROG
(PARI) list(lim)=my(v=List([1]), i, t); while(i++<=#v, t=2*v[i]+1; if(t>lim, next); listput(v, t); t+=v[i]; if(t>lim, next); listput(v, t); t+=t-1; if(t>lim, next); listput(v, t)); Set(v) \\ Charles R Greathouse IV, Jul 09 2017
(PARI) list(lim)=my(v=List([1]), m=Map(), t, i); while(i++<=#v, t=2*v[i]+1; if(t>lim, next); if(!mapisdefined(m, t), mapput(m, t, 0); listput(v, t)); t+=v[i]; if(t>lim, next); if(!mapisdefined(m, t), mapput(m, t, 0); listput(v, t)); t+=t-1; if(t<=lim && !mapisdefined(m, t), mapput(m, t, 0); listput(v, t))); m=0; Set(v) \\ Charles R Greathouse IV, Jul 09 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Feb 08 2011
EXTENSIONS
Name clarified by Charles R Greathouse IV, Jul 09 2017
STATUS
approved