|
|
A348761
|
|
For any nonnegative number n with binary expansion Sum_{k >= 0} b_k * 2^k, a(n) is the imaginary part of f(n) = Sum_{k >= 0} ((-1)^Sum_{j = 0..k-1} b_j) * (1+i)^k (where i denotes the imaginary unit); sequence A348760 gives the real part.
|
|
2
|
|
|
0, 0, 1, -1, 2, -2, -1, 1, 2, -2, -1, 1, 0, 0, 1, -1, 0, 0, 1, -1, 2, -2, -1, 1, 2, -2, -1, 1, 0, 0, 1, -1, -4, 4, 5, -5, 6, -6, -5, 5, 6, -6, -5, 5, -4, 4, 5, -5, 4, -4, -3, 3, -2, 2, 3, -3, -2, 2, 3, -3, 4, -4, -3, 3, -8, 8, 9, -9, 10, -10, -9, 9, 10, -10
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,5
|
|
COMMENTS
|
The function f defines a bijection from the nonnegative integers to the Gaussian integers.
|
|
LINKS
|
|
|
FORMULA
|
a(2^k) = A009545(k) for any k >= 0.
|
|
PROG
|
(PARI) a(n) = { my (v=0, k, o=-1); while (n, n-=2^k=valuation(n, 2); v+=(1+I)^k * (-1)^o++); imag(v) }
|
|
CROSSREFS
|
See A348691 for a similar sequence.
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|