OFFSET
0,6
COMMENTS
The representation of {f(n)} corresponds to the cross form of the Vicsek fractal.
As a set, {f(n)} corresponds to the Gaussian integers whose real and imaginary parts have not simultaneously a nonzero digit at the same place in their balanced ternary representations.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..15624
Rémy Sigrist, Colored representation of f(n) for n = 0..5^6-1 in the complex plan (where the hue is function of n)
Wikipedia, Vicsek fractal
FORMULA
a(n) = 0 iff the n-th row of A031219 has only even terms.
a(5*n) = 3*a(n).
a(5*n+1) = 3*a(n) + 1.
a(5*n+2) = 3*a(n).
a(5*n+3) = 3*a(n) - 1.
a(5*n+4) = 3*a(n).
EXAMPLE
For n = 103:
- 103 = 4*5^2 + 3*5^0,
- so f(123) = 3^2 * i^(4-1) + 3^0 * i^(3-1) = -1 - 9*i,
- and a(n) = -1.
PROG
(PARI) a(n) = { my (d=Vecrev(digits(n, 5))); real(sum (k=1, #d, if (d[k], 3^(k-1)*I^(d[k]-1), 0))) }
CROSSREFS
KEYWORD
sign,base
AUTHOR
Rémy Sigrist, Feb 12 2020
STATUS
approved