A050603 A001511 with every term repeated.
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, 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, 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
Offset: 0
Links
- James Spahlinger, Table of n, a(n) for n = 0..10000
- Cristian Cobeli, Mihai Prunescu, and Alexandru Zaharescu, A growth model based on the arithmetic Z-game, arXiv:1511.04315 [math.NT], 2015.
- Francis Laclé, 2-adic parity explorations of the 3n+1 problem, hal-03201180v2 [cs.DM], 2021.
Programs
-
Mathematica
With[{c=Table[Position[Reverse[IntegerDigits[n,2]],1,1,1],{n,110}]// Flatten}, Riffle[c,c]] (* Harvey P. Dale, Dec 06 2018 *) a[n_] := IntegerExponent[Floor[n/2]+1, 2] + 1; Array[a, 100, 0] (* Amiram Eldar, May 22 2025 *)
-
PARI
a(n)=valuation(n+2-n%2,2) \\ Charles R Greathouse IV, Oct 14 2013
-
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 */
-
Python
def A050603(n): return ((m:=n>>1)&~(m+1)).bit_length()+1 # Chai Wah Wu, Jul 07 2022
Formula
Equals A053398(2, n).
G.f.: (1+x)/x^2 * Sum(k>=1, x^(2^k)/(1-x^(2^k))). - Ralf Stephan, Apr 12 2002
a(n) = A136480(n+1). - Reinhard Zumkeller, Dec 31 2007
a(n) = A007814(n + 2 - n mod 2). - James Spahlinger, Oct 11 2013, corrected by Charles R Greathouse IV, Oct 14 2013
a(2n) = a(2n+1). 1 <= a(n) <= log_2(n+2). - Charles R Greathouse IV, Oct 14 2013
a(n) = (-1)^n * A094267(n). - Michael Somos, May 11 2014
a(n) = A007814(floor(n/2)+1). - Chai Wah Wu, Jul 07 2022
Asymptotic mean: lim_{m->oo} (1/m) * Sum_{k=0..m} a(k) = 2. - Amiram Eldar, Sep 15 2022
Extensions
Definition simplified by N. J. A. Sloane, Aug 27 2016
Comments