login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A171977
a(n) = 2^(k+1) where 2^k is the highest power of 2 dividing n.
18
2, 4, 2, 8, 2, 4, 2, 16, 2, 4, 2, 8, 2, 4, 2, 32, 2, 4, 2, 8, 2, 4, 2, 16, 2, 4, 2, 8, 2, 4, 2, 64, 2, 4, 2, 8, 2, 4, 2, 16, 2, 4, 2, 8, 2, 4, 2, 32, 2, 4, 2, 8, 2, 4, 2, 16, 2, 4, 2, 8, 2, 4, 2
OFFSET
1,1
COMMENTS
When read as a triangle in which the n-th row has 2^n terms, every row is the last half of the next one. All the terms are powers of 2. First column = 2*A000079.
The original definition was: a(n) = (A000265(2n+1) - 1) / A000265(2n).
a(n) seems to be the denominator of Euler(2*n+1,1) but I have no proof of this.
a(n) is also gcd[C(2n,1), C(2n,3), ..., C(2n,2n-1)]. - Franz Vrabec, Oct 22 2012
a(n) is also the ratio r(2n) = s2(2n)/s1(2n) where s1(2n) is the sum of the odd unitary divisors of 2n and s2(2n) is the sum of the even unitary divisors of 2n. - Michel Lagneau, Dec 19 2013
a(n) or a(n)/2 = A006519(n) is known as the Steinhaus sequence in probability theory, proposed as a sequence of asymptotically fair premiums for the St. Petersburg game. - Peter Kern, Aug 28 2015
After the all-1's sequence this is the next sequence in lexicographical order such that the gap between a(n) and the next occurrence of a(n) is given by a(n). - Scott R. Shannon, Oct 16 2019
First 2^(k-1) - 1 terms are also the areas of the successive rectangles and squares of width 2 that are adjacent to any of the four sides of the toothpick structure of A139250 after 2^k stages, with k >= 2. For example: if k = 5 the areas after 32 stages are [2, 4, 2, 8, 2, 4, 2, 16, 2, 4, 2, 8, 2, 4, 2] respectively, the same as the first 15 terms of this sequence. - Omar E. Pol, Dec 29 2020
LINKS
Sandor Csörgö and Gordon Simons, On Steinhaus' resolution of the St. Petersburg paradox, Probab. Math. Statist. 14 (1993), 157--172. MR1321758 (96b:60017). - Peter Kern, Aug 28 2015
Roger B. Eggleton, Aviezri S. Fraenkel, and R. Jamie Simpson, Beatty sequences and Langford sequences, Graph theory and combinatorics (Marseille-Luminy, 1990). Discrete Math. 111 (1993), no. 1-3, 165--178. MR1210094 (94a:11018). See Example 2.6. - N. J. A. Sloane, Mar 18 2012
Hugo Steinhaus, The so-called Petersburg paradox, Colloq. Math. 2 (1949), 56--58. MR0039937 (12,619e).
FORMULA
a(n) = (A000265(2*n+1)-1)/A000265(2*n).
a(n) = -(-n XOR n). XOR the bitwise operation on the two's complement representation for negative integers. - Peter Luschny, Jun 01 2011
a(n) = A038712(n)+1. - Franz Vrabec, Mar 03 2012
a(n) = 2^A001511(n). - Franz Vrabec, Oct 22 2012
a(n) = A046161(n)/A046161(n-1). - Johannes W. Meijer, Nov 04 2012
a(n) = 2^(1 + (A183063(n)/A001227(n))). - Omar E. Pol, Nov 06 2018
a(n) = 2*A006519(n). - Antti Karttunen, Nov 06 2018
MAPLE
a := proc(n) local k: k:=1: while frac(n/2^k) = 0 do k := k+1 end do: k := k-1: a(n) := 2^(k+1) end: seq(a(n), n=1..63); # Johannes W. Meijer, Nov 04 2012
seq(2^(1 + padic[ordp](n, 2)), n = 1..63); # Peter Luschny, Nov 27 2020
MATHEMATICA
Table[-BitXor[-i, i], {i, 200}] (* Peter Luschny, Jun 01 2011 *)
a[n_] := 2^(IntegerExponent[n, 2] + 1); Array[a, 100] (* Jean-François Alcover, May 09 2017 *)
PROG
(PARI) A171977(n) = 2^(1+valuation(n, 2)); \\ Antti Karttunen, Nov 06 2018
(Python)
def A171977(n): return (n&-n)<<1 # Chai Wah Wu, Jul 13 2022
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Paul Curtz, Nov 19 2010
EXTENSIONS
I edited this sequence, based on an email message from the author. - N. J. A. Sloane, Nov 20 2010
Definition simplified by N. J. A. Sloane, Mar 18 2012
STATUS
approved