OFFSET
0,4
COMMENTS
The representation of {(a(n), A332498(n))} is related to the T-square fractal (see illustration in Links section).
We can iteratively build the set {(a(n), A332498(n))} as follows:
- start with X_0 = {(0, 0)},
- for k = 0, 1, ..., X_{k+1} is obtained by adjoining to X_k:
- an horizontally mirrored copy of X_k to the right,
- and a vertically mirrored copy of X_k on the top,
- this corresponds to the following substitution:
.---.
.---. | V |
| X | --> .---.---.
.---. | X | H |
.---.---.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..6560
Rémy Sigrist, Representation of (a(n), A332498(n)) for n = 0..3^10-1
Rémy Sigrist, Interactive scatterplot of a 3D analog [Provided your web browser supports the Plotly library, you should see icons on the top right corner of the page: if you choose "Orbital rotation", then you will be able to rotate the plot alongside three axes]
Wikipedia, T-square (fractal)
FORMULA
a(n) = 0 iff n belongs to A005823.
EXAMPLE
For n = 42:
- the ternary representation of 42 is "1120",
- x(0) = 0,
- x(1) = x(0) = 0 (as d_0 = 0 <> 1),
- x(2) = x(1) = 0 (as d_1 = 2 <> 1),
- x(3) = 2^3-1 - x(2) = 7 (as d_2 = 1),
- x(4) = 2^4-1 - x(3) = 8 (as d_3 = 1),
- hence a(42) = 8.
PROG
(PARI) a(n) = { my (x=0, k=1); while (n, if (n%3==1, x=2^k-1-x); n\=3; k++); x }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Feb 14 2020
STATUS
approved