login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A014682 The Collatz or 3x+1 function: a(n) = n/2 if n is even, otherwise (3n+1)/2. 22
0, 2, 1, 5, 2, 8, 3, 11, 4, 14, 5, 17, 6, 20, 7, 23, 8, 26, 9, 29, 10, 32, 11, 35, 12, 38, 13, 41, 14, 44, 15, 47, 16, 50, 17, 53, 18, 56, 19, 59, 20, 62, 21, 65, 22, 68, 23, 71, 24, 74, 25, 77, 26, 80, 27, 83, 28, 86, 29, 89, 30, 92, 31, 95, 32, 98, 33, 101, 34, 104 (list; graph; refs; listen; history; internal format)
OFFSET

0,2

COMMENTS

This is the function usually denoted by T(n) in the literature on the 3x+1 problem. See A006370 for further references and links.

Intertwining of sequence '2,5,8,11,... ("add 3")' and the nonnegative integers.

a(n) = log to the base 2 of A076936(n). - Amarnath Murthy (amarnath_murthy(AT)yahoo.com), Oct 19 2002

Partial sums are A093353. - Paul Barry (pbarry(AT)wit.ie), Mar 31 2008

Absolute first differences are essentially in A014681 and A103889. - R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Apr 05 2008

a(n)= 5/4 + (1/2)*((-1)^n)*n + (3/4)*(-1)^n + n - Alexander R. Povolotsky (pevnev(AT)juno.com), Apr 05 2008

REFERENCES

J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010.

LINKS

N. J. A. Sloane, Table of n, a(n) for n = 0..1000

Index entries for sequences related to 3x+1 (or Collatz) problem

FORMULA

G.f.: x(2+x+x^2)/(1-x^2)^2; a(n)=(4n+1)/4-(2n+1)(-1)^n/4 [offset 0]. - Paul Barry (pbarry(AT)wit.ie), Mar 31 2008

a(n) = -a(n-1) + a(n-2) + a(n-3) + 4 - John W. Layman (layman(AT)math.vt.edu)

For n > 1 this is the image of n under the modified "3x+1" map (cf. A006370): n -> n/2 if n is even, n -> (3n+1)/2 if n is odd. - Benoit Cloitre (benoit7848c(AT)orange.fr), May 12 2002

O.g.f.: x*(2+x+x^2)/[(-1+x)^2*(1+x)^2]. - R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Apr 05 2008

MAPLE

T:=proc(n) if n mod 2 = 0 then n/2 else (3*n+1)/2; fi; end; (From N. J. A. Sloane, Jan 31 2011]

A076936 := proc(n) option remember ; local apr, ifr, me, i, a ; if n <=2 then n^2 ; else apr := mul(A076936(i), i=1..n-1) ; ifr := ifactors(apr)[2] ; me := -1 ; for i from 1 to nops(ifr) do me := max(me, op(2, op(i, ifr))) ; od ; me := me+ n-(me mod n) ; a := 1 ; for i from 1 to nops(ifr) do a := a*op(1, op(i, ifr))^(me-op(2, op(i, ifr))) ; od ; if a = A076936(n-1) then me := me+n ; a := 1 ; for i from 1 to nops(ifr) do a := a*op(1, op(i, ifr))^(me-op(2, op(i, ifr))) ; od ; fi ; RETURN(a) ; fi ; end: A014682 := proc(n) log[2](A076936(n)) ; end: for n from 1 to 85 do printf("%d, ", A014682(n)) ; od ; - R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Mar 20 2007

MATHEMATICA

Collatz[n_?OddQ] := (3n + 1)/2; Collatz[n_?EvenQ] := n/2; Table[Collatz[n], {n, 0, 79}] (* From Alonso del Arte, Apr 21 2011 *)

CROSSREFS

Cf. A076936, A076938, A016116, A126241, A060412, A060413.

Cf. A006370.

Sequence in context: A185727 A070951 A076937 * A111361 A167160 A205377

Adjacent sequences:  A014679 A014680 A014681 * A014683 A014684 A014685

KEYWORD

nonn,easy

AUTHOR

Mohammad K. Azarian (ma3(AT)evansville.edu)

EXTENSIONS

Edited by N. J. A. Sloane (njas(AT)research.att.com), Apr 26 2008, at the suggestion of Artur Jasinski (grafix(AT)csl.pl)

Edited by N. J. A. Sloane, Jan 31 2011

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 17 09:41 EST 2012. Contains 206009 sequences.