login
A318439
For any n >= 0 with binary expansion Sum_{k=0..w} b_k * 2^k, let h(n) = Sum_{k=0..w} b_k * (i-1)^k (where i denotes the imaginary unit); a(n) is the imaginary part of h(n).
7
0, 0, 1, 1, -2, -2, -1, -1, 2, 2, 3, 3, 0, 0, 1, 1, 0, 0, 1, 1, -2, -2, -1, -1, 2, 2, 3, 3, 0, 0, 1, 1, -4, -4, -3, -3, -6, -6, -5, -5, -2, -2, -1, -1, -4, -4, -3, -3, -4, -4, -3, -3, -6, -6, -5, -5, -2, -2, -1, -1, -4, -4, -3, -3, 8, 8, 9, 9, 6, 6, 7, 7, 10
OFFSET
0,5
COMMENTS
See A318438 for the real part of h and additional comments.
FORMULA
a(2^k) = A108520(k-1) for any k > 0.
PROG
(PARI) a(n) = my (d=Vecrev(digits(n, 2))); imag(sum(i=1, #d, d[i]*(I-1)^(i-1)))
CROSSREFS
Sequence in context: A349040 A165123 A372428 * A106180 A274369 A055091
KEYWORD
sign,look,base
AUTHOR
Rémy Sigrist, Aug 26 2018
STATUS
approved