This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A033491 #53 Feb 16 2025 08:32:36 %S A033491 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, %T A033491 33,65,130,43,86,172,57,114,39,78,153,305,105,203,406,135,270,540,185, %U A033491 361,123,246,481,169,329,641,219,427,159,295,569,1138,379,758,283,505 %N A033491 a(n) is the smallest integer that takes n halving and tripling steps to reach 1 in the 3x+1 problem. %C A033491 a(n) is the smallest term in n-th row of A127824. - _Reinhard Zumkeller_, Nov 29 2012 %C A033491 Interestingly, there are many n such that a(n) = 2*a(n-1). - _Dmitry Kamenetsky_, Feb 11 2017 %C A033491 a(n) is the position of the first occurrence of n in A006577. - _Sean A. Irvine_, Jul 07 2020 %H A033491 T. D. Noe, <a href="/A033491/b033491.txt">Table of n, a(n) for n = 0..1924</a> (from Eric Roosendaal's data) [Roosendaal's table is now complete through 2007 - _N. J. A. Sloane_, Oct 21 2012] %H A033491 Eric Roosendaal, <a href="http://www.ericr.nl/wondrous/classrec.html">3x+1 Class Records</a> %H A033491 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/CollatzProblem.html">Collatz Problem</a> %H A033491 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a> %t A033491 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 %t A033491 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 *) %o A033491 (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) %o A033491 (Haskell) %o A033491 a033491 = head . a127824_row -- _Reinhard Zumkeller_, Nov 29 2012 %o A033491 (Python) %o A033491 import numpy %o A033491 nupto = 62 %o A033491 A033491 = numpy.zeros(nupto, dtype=object) %o A033491 k, counter = 1, 0 %o A033491 while counter < nupto: %o A033491 kk, n = k, 0 %o A033491 while n <= nupto and kk != 1: %o A033491 if kk % 2 == 0: %o A033491 kk //= 2 %o A033491 else: %o A033491 kk = (kk*3+1)//2 %o A033491 n += 1 %o A033491 n += 1 %o A033491 if n < nupto and not A033491[n]: %o A033491 A033491[n] = k %o A033491 counter += 1 %o A033491 k += 1 %o A033491 print(list(A033491)) # _Karl-Heinz Hofmann_, Feb 11 2023 %Y A033491 Cf. A126727 (missing numbers). %Y A033491 Cf. A006577, A127824. %K A033491 nonn,nice,look %O A033491 0,2 %A A033491 _Jeff Burch_ %E A033491 More terms from Larry Reeves (larryr(AT)acm.org), Apr 27 2001