login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A033491 a(n) is the smallest integer that takes n halving and tripling steps to reach 1 in the 3x+1 problem. 13
1, 2, 4, 8, 16, 5, 10, 3, 6, 12, 24, 48, 17, 34, 11, 22, 7, 14, 28, 9, 18, 36, 72, 25, 49, 98, 33, 65, 130, 43, 86, 172, 57, 114, 39, 78, 153, 305, 105, 203, 406, 135, 270, 540, 185, 361, 123, 246, 481, 169, 329, 641, 219, 427, 159, 295, 569, 1138, 379, 758, 283, 505 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
a(n) is the smallest term in n-th row of A127824. - Reinhard Zumkeller, Nov 29 2012
Interestingly, there are many n such that a(n) = 2*a(n-1). - Dmitry Kamenetsky, Feb 11 2017
a(n) is the position of the first occurrence of n in A006577. - Sean A. Irvine, Jul 07 2020
LINKS
T. D. Noe, Table of n, a(n) for n = 0..1924 (from Eric Roosendaal's data) [Roosendaal's table is now complete through 2007 - N. J. A. Sloane, Oct 21 2012]
Eric Roosendaal, 3x+1 Class Records
Eric Weisstein's World of Mathematics, Collatz Problem
MATHEMATICA
f[ n_ ] := Module[ {i = 0, m = n}, While[ m != 1, m = If[ OddQ[ m ], 3m + 1, m/2 ]; i++ ]; i ]; a = Table[ 0, {75} ]; Do[ m = f[ n ]; If[ a[[ m + 1 ]] == 0, a[[ m + 1 ]] = n ], {n, 1, 1250} ]; a
With[{c=Table[Length[NestWhileList[If[OddQ[#], 3#+1, #/2]&, n, #!=1&]], {n, 2000}]}, Flatten[Table[Position[c, i, 1, 1], {i, 70}]]] (* Harvey P. Dale, Jan 06 2013 *)
PROG
(PARI) a(n)=if(n<0, 0, k=1; while(abs(if(k<0, 0, s=k; c=1; while((1-(s%2))*s/2+(s%2)*(3*s+1)>1, s=(1-(s%2))*s/2+(s%2)*(3*s+1); c++); c)-n-1)>0, k++); k)
(Haskell)
a033491 = head . a127824_row -- Reinhard Zumkeller, Nov 29 2012
(Python)
import numpy
nupto = 62
A033491 = numpy.zeros(nupto, dtype=object)
k, counter = 1, 0
while counter < nupto:
kk, n = k, 0
while n <= nupto and kk != 1:
if kk % 2 == 0:
kk //= 2
else:
kk = (kk*3+1)//2
n += 1
n += 1
if n < nupto and not A033491[n]:
A033491[n] = k
counter += 1
k += 1
print(list(A033491)) # Karl-Heinz Hofmann, Feb 11 2023
CROSSREFS
Cf. A126727 (missing numbers).
Sequence in context: A302030 A167426 A261702 * A050076 A276070 A070337
KEYWORD
nonn,nice,look
AUTHOR
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), Apr 27 2001
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 22:18 EDT 2024. Contains 371782 sequences. (Running on oeis4.)