login
A094120
a(n) = Sum_{k=1..n} Sum_{i=1..k} (-2)^valuation(i,2).
1
0, 1, 0, 0, 4, 9, 12, 16, 12, 9, 4, 0, 0, 1, 0, 0, 16, 33, 48, 64, 84, 105, 124, 144, 156, 169, 180, 192, 208, 225, 240, 256, 240, 225, 208, 192, 180, 169, 156, 144, 124, 105, 84, 64, 48, 33, 16, 0, 0, 1, 0, 0, 4, 9, 12, 16, 12, 9, 4, 0, 0, 1, 0, 0, 64, 129, 192, 256, 324, 393
OFFSET
0,5
LINKS
Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Identities and periodic oscillations of divide-and-conquer recurrences splitting at half, arXiv:2210.10968 [cs.DS], 2022, pp. 49-51.
MATHEMATICA
{0}~Join~Accumulate@ Accumulate@ Array[(-2)^IntegerExponent[#, 2] &, 69] (* Michael De Vlieger, Oct 30 2022 *)
PROG
(PARI) a(n)=sum(k=1, n, sum(i=1, k, (-2)^valuation(i, 2)))
CROSSREFS
Cf. A006519.
Sequence in context: A312853 A312854 A010386 * A066423 A355571 A376164
KEYWORD
nonn
AUTHOR
Benoit Cloitre, May 03 2004
STATUS
approved