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 A050603 #58 May 22 2025 08:34:54 %S A050603 1,1,2,2,1,1,3,3,1,1,2,2,1,1,4,4,1,1,2,2,1,1,3,3,1,1,2,2,1,1,5,5,1,1, %T A050603 2,2,1,1,3,3,1,1,2,2,1,1,4,4,1,1,2,2,1,1,3,3,1,1,2,2,1,1,6,6,1,1,2,2, %U A050603 1,1,3,3,1,1,2,2,1,1,4,4,1,1,2,2,1,1,3,3,1,1,2,2,1,1,5,5,1,1,2,2,1,1,3,3,1,1,2,2,1,1,4 %N A050603 A001511 with every term repeated. %C A050603 Column 2 of A050600: a(n) = add1c(n,2). %C A050603 Absolute values of A094267. %C A050603 Consider the Collatz (or 3x+1) problem and the iterative sequence c(k) where c(0)=n is a positive integer and c(k+1)=c(k)/2 if c(k) is even, c(k+1)=(3*c(k)+1)/2 if c(k) is odd. Then a(n) is the minimum number of iterations in order to have c(a(n)) odd if n is even or c(a(n)) even if n is odd. - _Benoit Cloitre_, Nov 16 2001 %H A050603 James Spahlinger, <a href="/A050603/b050603.txt">Table of n, a(n) for n = 0..10000</a> %H A050603 Cristian Cobeli, Mihai Prunescu, and Alexandru Zaharescu, <a href="http://arxiv.org/abs/1511.04315">A growth model based on the arithmetic Z-game</a>, arXiv:1511.04315 [math.NT], 2015. %H A050603 Francis Laclé, <a href="https://hal.archives-ouvertes.fr/hal-03201180v2">2-adic parity explorations of the 3n+1 problem</a>, hal-03201180v2 [cs.DM], 2021. %F A050603 Equals A053398(2, n). %F A050603 G.f.: (1+x)/x^2 * Sum(k>=1, x^(2^k)/(1-x^(2^k))). - _Ralf Stephan_, Apr 12 2002 %F A050603 a(n) = A136480(n+1). - _Reinhard Zumkeller_, Dec 31 2007 %F A050603 a(n) = A007814(n + 2 - n mod 2). - _James Spahlinger_, Oct 11 2013, corrected by _Charles R Greathouse IV_, Oct 14 2013 %F A050603 a(2n) = a(2n+1). 1 <= a(n) <= log_2(n+2). - _Charles R Greathouse IV_, Oct 14 2013 %F A050603 a(n) = A007814(n+1)+A007814(n+2). %F A050603 a(n) = (-1)^n * A094267(n). - _Michael Somos_, May 11 2014 %F A050603 a(n) = A007814(floor(n/2)+1). - _Chai Wah Wu_, Jul 07 2022 %F A050603 Asymptotic mean: lim_{m->oo} (1/m) * Sum_{k=0..m} a(k) = 2. - _Amiram Eldar_, Sep 15 2022 %t A050603 With[{c=Table[Position[Reverse[IntegerDigits[n,2]],1,1,1],{n,110}]// Flatten}, Riffle[c,c]] (* _Harvey P. Dale_, Dec 06 2018 *) %t A050603 a[n_] := IntegerExponent[Floor[n/2]+1, 2] + 1; Array[a, 100, 0] (* _Amiram Eldar_, May 22 2025 *) %o A050603 (PARI) a(n)=valuation(n+2-n%2,2) \\ _Charles R Greathouse IV_, Oct 14 2013 %o A050603 (PARI) {a(n) = my(A); if( n<0, 0, A = sum(k=1, length( binary(n+2)) - 1, x^(2^k) / (1 - x^(2^k)), x^3 * O(x^n)); polcoeff( A * (1 + x) / x^2, n))}; /* _Michael Somos_, May 11 2014 */ %o A050603 (Python) %o A050603 def A050603(n): return ((m:=n>>1)&~(m+1)).bit_length()+1 # _Chai Wah Wu_, Jul 07 2022 %Y A050603 Bisection gives column 1 of A050600: A001511. %Y A050603 Cf. A007814, A053398, A094267, A136480. %K A050603 nonn,easy %O A050603 0,3 %A A050603 _Antti Karttunen_ Jun 22 1999 %E A050603 Definition simplified by _N. J. A. Sloane_, Aug 27 2016