OFFSET
0,3
COMMENTS
The lattice points with coordinates (a(n), A334889(n)) for n >= 0 form a Sierpinski carpet.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..4095 (n = 0..8^4-1)
Rémy Sigrist, Colored scatterplot of (a(n), A334889(n)) for n = 0..8^6-1 (where the hue is function of n)
Wikipedia, Sierpinski carpet
EXAMPLE
For n = 42:
- 42 = 5*8^1 + 2*8^0,
- so a(42) = f(5)*3^1 + f(2)*3^0 = 1*3^1 + 2*3^0 = 5.
PROG
(PARI) a(n) = { my (f=[0, 1, 2, 2, 2, 1, 0, 0], d=Vecrev(digits(n, #f))); sum(k=0, #d-1, f[1+d[1+k]] * 3^k) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, May 14 2020
STATUS
approved