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”).

A320042
a(n) = a(floor(n/2)) + (-1)^(n*(n+1)/2) with a(1)=0.
1
0, -1, 1, 0, -2, 0, 2, 1, -1, -3, -1, 1, -1, 1, 3, 2, 0, -2, 0, -2, -4, -2, 0, 2, 0, -2, 0, 2, 0, 2, 4, 3, 1, -1, 1, -1, -3, -1, 1, -1, -3, -5, -3, -1, -3, -1, 1, 3, 1, -1, 1, -1, -3, -1, 1, 3, 1, -1, 1, 3, 1, 3, 5, 4, 2, 0, 2, 0, -2, 0, 2, 0, -2, -4, -2, 0, -2, 0, 2, 0
OFFSET
1,5
COMMENTS
For 2^(2*k-1) - 1 < n < 2^(2*k), k>0, there's no n such that a(n)=0.
For 2^(2*k) - 1 < n < 2^(2*k+1), k>0, there are A000984(k+1) n's such that a(n)=0.
LINKS
FORMULA
a(1) = 0, a(n) = a(floor(n/2)) + (-1)^(n*(n+1)/2).
a(n) = 2*A092339(n+1) - A000523(n).
EXAMPLE
a(9) = a(4) + (-1)^45 = -1, a(10) = a(5) + (-1)^55 = -3.
For 7 < n < 16, there's no n such that a(n)=0; for 15 < n < 32, there are 6 n's such that a(n)=0.
MAPLE
a:=proc(n) `if`(n=1, 0, a(floor(n/2))+(-1)^(n*(n+1)/2)) end: seq(a(n), n=1..100); # Muniru A Asiru, Oct 07 2018
MATHEMATICA
a[1] = 0; a[n_] := a[n] = a[Floor[n/2]] + (-1)^(n*(n + 1)/2); Table[a@n, {n, 1, 50}]
PROG
(PARI) a(n) = if (n==1, 0, a(n\2) + (-1)^(n*(n+1)/2)); \\ Michel Marcus, Oct 05 2018
CROSSREFS
KEYWORD
sign,look,hear
AUTHOR
Jinyuan Wang, Oct 03 2018
EXTENSIONS
More terms from Michel Marcus, Oct 05 2018
STATUS
approved