The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A006370 The Collatz or 3x+1 map: a(n) = n/2 if n is even, 3n + 1 if n is odd. (Formerly M3198) 137
 0, 4, 1, 10, 2, 16, 3, 22, 4, 28, 5, 34, 6, 40, 7, 46, 8, 52, 9, 58, 10, 64, 11, 70, 12, 76, 13, 82, 14, 88, 15, 94, 16, 100, 17, 106, 18, 112, 19, 118, 20, 124, 21, 130, 22, 136, 23, 142, 24, 148, 25, 154, 26, 160, 27, 166, 28, 172, 29, 178, 30, 184, 31, 190, 32, 196, 33 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,2 COMMENTS The 3x+1 or Collatz problem is as follows: start with any number n. If n is even, divide it by 2, otherwise multiply it by 3 and add 1. Do we always reach 1? This is an unsolved problem. It is conjectured that the answer is yes. The Krasikov-Lagarias paper shows that at least N^0.84 of the positive numbers < N fall into the 4-2-1 cycle of the 3x+1 problem. This is far short of what we think is true, that all positive numbers fall into this cycle, but it is a step. - Richard C. Schroeppel, May 01 2002 Also A001477 and A016957 interleaved. - Omar E. Pol, Jan 16 2014, updated Nov 07 2017 a(n) is the image of a(2*n) under the 3*x+1 map. - L. Edson Jeffery, Aug 17 2014 REFERENCES R. K. Guy, Unsolved Problems in Number Theory, E16. J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010. N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). LINKS T. D. Noe, Table of n, a(n) for n = 0..1000 Darrell Cox, The 3n + 1 Problem: A Probabilistic Approach, Journal of Integer Sequences, Vol. 15 (2012), #12.5.2. David Eisenbud and Brady Haran, UNCRACKABLE? The Collatz Conjecture, Numberphile Video, 2016. I. Krasikov and J. C. Lagarias, Bounds for the 3x+1 Problem using Difference Inequalities, arXiv:math/0205002 [math.NT], 2002. J. C. Lagarias, The 3x+1 problem and its generalizations, Amer. Math. Monthly, 92 (1985), 3-23. J. C. Lagarias, The set of rational cycles for the 3x+1 problem, Acta Arithmetica, LVI (1990), pp. 33-53. J. C. Lagarias, The 3x+1 Problem: An Annotated Bibliography (1963-2000), arXiv:math/0309224 [math.NT], 2003-2011. J. C. Lagarias, The 3x+1 Problem: an annotated bibliography, II (2000-2009), arXiv:math/0608208 [math.NT], 2006-2012. E. Roosendaal, On the 3x+1 problem Simon Plouffe, Approximations de séries génératrices et quelques conjectures, Dissertation, Université du Québec à Montréal, 1992. Simon Plouffe, 1031 Generating Functions and Conjectures, Université du Québec à Montréal, 1992. S. Schreiber & N. J. A. Sloane, Correspondence, 1980 Eric Weisstein's World of Mathematics, Collatz Problem Wikipedia, Collatz conjecture Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1). FORMULA G.f.: (4x+x^2+2x^3) / (1-x^2)^2. a(n) = (1/4)(7n+2-(-1)^n(5n+2)). - Benoit Cloitre, May 12 2002 a(n) = ((n mod 2)*2 + 1)*n/(2 - (n mod 2)) + (n mod 2). - Reinhard Zumkeller, Sep 12 2002 a(n) = A014682(n+1) * A000034(n). - R. J. Mathar, Mar 09 2009 a(n) = a(a(2*n)) = -A001281(-n) for all n in Z. - Michael Somos, Nov 10 2016 E.g.f.: (2 + x)*sinh(x)/2 + 3*x*cosh(x). - Ilya Gutkovskiy, Dec 20 2016 EXAMPLE G.f. = 4*x + x^2 + 10*x^3 + 2*x^4 + 16*x^5 + 3*x^6 + 22*x^7 + 4*x^8 + 28*x^9 + ... MAPLE f := n-> if n mod 2 = 0 then n/2 else 3*n+1; fi; A006370:=(4+z+2*z**2)/(z-1)**2/(1+z)**2; # Simon Plouffe in his 1992 dissertation; uses offset 0 MATHEMATICA f[n_]:=If[EvenQ[n], n/2, 3n+1]; Table[f[n], {n, 50}] (* Geoffrey Critzer, Jun 29 2013 *) LinearRecurrence[{0, 2, 0, -1}, {4, 1, 10, 2}, 70] (* Harvey P. Dale, Jul 19 2016 *) PROG (PARI) for(n=1, 100, print1((1/4)*(7*n+2-(-1)^n*(5*n+2)), ", ")) (PARI) A006370(n)=if(n%2, 3*n+1, n/2) \\ Michael B. Porter, May 29 2010 (Haskell) a006370 n | m /= 0    = 3 * n + 1           | otherwise = n' where (n', m) = divMod n 2 -- Reinhard Zumkeller, Oct 07 2011 (Python) def A006370(n): ....q, r = divmod(n, 2) ....return 3*n+1 if r else q # Chai Wah Wu, Jan 04 2015 (MAGMA) [(1/4)*(7*n+2-(-1)^n*(5*n+2)): n in [1..70]]; // Vincenzo Librandi, Dec 20 2016 CROSSREFS Cf. A139391, A016945, A005408, A016825, A082286, A070165. A006577 gives number of steps to reach 1. Cf. A001281. Sequence in context: A209385 A121529 A304429 * A262370 A108759 A158824 Adjacent sequences:  A006367 A006368 A006369 * A006371 A006372 A006373 KEYWORD nonn,nice,easy AUTHOR EXTENSIONS More terms from Larry Reeves (larryr(AT)acm.org), Apr 27 2001 Zero prepended and new Name from N. J. A. Sloane at suggestion of M. F. Hasler, Nov 06 2017 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified April 5 19:56 EDT 2020. Contains 333260 sequences. (Running on oeis4.)