cp's OEIS Frontend

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.

A160467 a(n) = 1 if n is odd; otherwise, a(n) = 2^(k-1) where 2^k is the largest power of 2 that divides n.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 8, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 16, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 8, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 32, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 8, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 16
Offset: 1

Views

Author

Johannes W. Meijer, May 24 2009, Jun 28 2011

Keywords

Comments

Fifth factor of the row sums A160466 of the Eta triangle A160464.
From Peter Luschny, May 31 2009: (Start)
Let odd(n) be the characteristic function of the odd numbers (A000035) and sigma(n) the number of 1's in binary expansion of n (A000120). Then a(n) = 2^(sigma(n-1) - sigma(n) + odd(n)).
Let B_{n} be the Bernoulli number. Then this sequence is also
a(n) = denominator(4*(4^n-1)*B_{2*n}/n). (End)

Crossrefs

Programs

  • Maple
    nmax:=96: p:= floor(log[2](nmax)): for n from 1 to nmax do a(n):=1 end do: for q from 1 to p do for n from 1 to nmax do if n mod 2^q = 0 then a(n):= 2^(q-1) end if: end do: end do: seq(a(n), n=1..nmax);
    From Peter Luschny, May 31 2009: (Start)
    a := proc(n) local sigma; sigma := proc(n) local i; add(i,i=convert(n,base,2)) end; 2^(sigma(n-1)-sigma(n)+`if`(type(n,odd),1,0)) end: seq(a(n), n=1..96);
    a := proc(n) denom(4*(4^n-1)*bernoulli(2*n)/n) end: seq(a(n), n=1..96); (End)
  • Mathematica
    a[n_] := If[OddQ[n], 1, 2^(IntegerExponent[n, 2] - 1)]; Array[a, 100] (* Amiram Eldar, Jul 02 2020 *)
  • PARI
    A160467(n) = 2^max(valuation(n,2)-1,0); \\ Antti Karttunen, Nov 18 2017, after Max Alekseyev's Feb 09 2011 formula.
    
  • Python
    def A160467(n): return max(1,(n&-n)>>1) # Chai Wah Wu, Jul 08 2022

Formula

a(n) = A026741(n)/A000265(n). - Paul Curtz, Apr 18 2010
a(n) = 2^max(A007814(n) - 1, 0). - Max Alekseyev, Feb 09 2011
a((2*n-1)*2^p) = A011782(p), p >= 0 and n >= 1. - Johannes W. Meijer, Jan 25 2013
a(n) = (1 + A140670(n))/2. - Antti Karttunen, Nov 18 2017
From Amiram Eldar, Dec 31 2022: (Start)
Dirichlet g.f.: zeta(s)*(2^s-2+1/2^s)/(2^s-2).
Sum_{k=1..n} a(k) ~ (1/(4*log(2)))*n*log(n) + (5/8 + (gamma-1)/(4*log(2)))*n, where gamma is Euler's constant (A001620). (End)
a(n) = A006519(n)/gcd(n,2). - Ridouane Oudra, Feb 08 2025
a(n) = A000010(A006519(n)). - Ridouane Oudra, Jul 27 2025

Extensions

Keyword mult added by Max Alekseyev, Feb 09 2011
Name changed by Antti Karttunen, Nov 18 2017