OFFSET
0,10
COMMENTS
See A318706 for the imaginary part of g.
See A318707 for the square of the modulus of g.
The following diagrams shows s(k) for k = 0..8 in the complex plane:
|
|
s(4) s(3) s(2)
|
---s(5)--s(0)--s(1)---
|
s(6) s(7) s(8)
|
|
The function g defines a bijection from the nonnegative integers to the Gaussian integers.
This sequence has similarities with A316657.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..6560
Rémy Sigrist, Colored scatterplot of (a(n), A318706(n)) for n = 0..9^6-1 (where the hue is function of n)
FORMULA
a(9 * k) = 3 * a(k) for any k >= 0.
PROG
(PARI) a(n) = my (d=Vecrev(digits(n, 9))); real(sum(k=1, #d, if (d[k], 3^(k-1)*I^floor((d[k]-1)/2)*(1+I)^((d[k]-1)%2), 0)))
CROSSREFS
KEYWORD
sign,base
AUTHOR
Rémy Sigrist, Sep 01 2018
STATUS
approved