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.

This page as a plain text file.
%I A160467 #52 Jul 27 2025 04:22:06
%S A160467 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,
%T A160467 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,
%U A160467 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
%N 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.
%C A160467 Fifth factor of the row sums A160466 of the Eta triangle A160464.
%C A160467 From _Peter Luschny_, May 31 2009: (Start)
%C A160467 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)).
%C A160467 Let B_{n} be the Bernoulli number. Then this sequence is also
%C A160467 a(n) = denominator(4*(4^n-1)*B_{2*n}/n). (End)
%H A160467 Antti Karttunen, <a href="/A160467/b160467.txt">Table of n, a(n) for n = 1..16384</a>
%F A160467 a(n) = A026741(n)/A000265(n). - _Paul Curtz_, Apr 18 2010
%F A160467 a(n) = 2^max(A007814(n) - 1, 0). - _Max Alekseyev_, Feb 09 2011
%F A160467 a((2*n-1)*2^p) = A011782(p), p >= 0 and n >= 1. - _Johannes W. Meijer_, Jan 25 2013
%F A160467 a(n) = (1 + A140670(n))/2. - _Antti Karttunen_, Nov 18 2017
%F A160467 From _Amiram Eldar_, Dec 31 2022: (Start)
%F A160467 Dirichlet g.f.: zeta(s)*(2^s-2+1/2^s)/(2^s-2).
%F A160467 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)
%F A160467 a(n) = A006519(n)/gcd(n,2). - _Ridouane Oudra_, Feb 08 2025
%F A160467 a(n) = A000010(A006519(n)). - _Ridouane Oudra_, Jul 27 2025
%p A160467 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);
%p A160467 From _Peter Luschny_, May 31 2009: (Start)
%p A160467 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);
%p A160467 a := proc(n) denom(4*(4^n-1)*bernoulli(2*n)/n) end: seq(a(n), n=1..96); (End)
%t A160467 a[n_] := If[OddQ[n], 1, 2^(IntegerExponent[n, 2] - 1)]; Array[a, 100] (* _Amiram Eldar_, Jul 02 2020 *)
%o A160467 (PARI) A160467(n) = 2^max(valuation(n,2)-1,0); \\ _Antti Karttunen_, Nov 18 2017, after _Max Alekseyev_'s Feb 09 2011 formula.
%o A160467 (Python)
%o A160467 def A160467(n): return max(1,(n&-n)>>1) # _Chai Wah Wu_, Jul 08 2022
%Y A160467 Cf. A000265, A001620, A007814, A026741, A140670, A160464, A220466, A006519, A000010.
%K A160467 base,easy,nonn,mult
%O A160467 1,4
%A A160467 _Johannes W. Meijer_, May 24 2009, Jun 28 2011
%E A160467 Keyword mult added by _Max Alekseyev_, Feb 09 2011
%E A160467 Name changed by _Antti Karttunen_, Nov 18 2017