A318438 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 real part of h(n).
0, 1, -1, 0, 0, 1, -1, 0, 2, 3, 1, 2, 2, 3, 1, 2, -4, -3, -5, -4, -4, -3, -5, -4, -2, -1, -3, -2, -2, -1, -3, -2, 4, 5, 3, 4, 4, 5, 3, 4, 6, 7, 5, 6, 6, 7, 5, 6, 0, 1, -1, 0, 0, 1, -1, 0, 2, 3, 1, 2, 2, 3, 1, 2, 0, 1, -1, 0, 0, 1, -1, 0, 2, 3, 1, 2, 2, 3, 1, 2
Offset: 0
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..10000
- Rémy Sigrist, Colored scatterplot of (a(n), A318439(n)) for n = 0..2^20-1 (where the hue is function of n)
- Wikipedia, Base -1+/-i
- Index entries for sequences related to binary expansion of n
Crossrefs
Programs
-
PARI
a(n) = my (d=Vecrev(digits(n,2))); real(sum(i=1, #d, d[i]*(I-1)^(i-1)))
Formula
a(2^k) = A009116(k) for any k >= 0.
Comments