login
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).
7
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,9
COMMENTS
See A318439 for the imaginary part of h.
See A318479 for the square of the modulus of h.
The function h corresponds to the interpretation of the binary representation of a number in base -1+i and defines a bijection from the nonnegative integers to the Gaussian integers.
The function h has nice fractal features (see scatterplot in Links section).
This sequence has similarities with A316657.
FORMULA
a(2^k) = A009116(k) for any k >= 0.
PROG
(PARI) a(n) = my (d=Vecrev(digits(n, 2))); real(sum(i=1, #d, d[i]*(I-1)^(i-1)))
CROSSREFS
Cf. A009116, A318439 (imaginary part), A318479 (norm), A340669 (negation).
Cf. A316657 (base 2+i).
Sequence in context: A194306 A283325 A353707 * A294233 A121884 A079087
KEYWORD
sign,look,base
AUTHOR
Rémy Sigrist, Aug 26 2018
STATUS
approved