|
|
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.
|
|
5
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
COMMENTS
|
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)
|
|
LINKS
|
|
|
FORMULA
|
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)
|
|
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);
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 *)
|
|
PROG
|
(Python)
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,easy,nonn,mult
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|