[go: up one dir, main page]

login
A335359
a(n) is the Y-coordinate of the n-th point of the Koch curve; sequence A335358 gives X-coordinates.
2
0, 0, 1, 0, 0, 1, 2, 2, 3, 2, 2, 1, 0, 0, 1, 0, 0, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 6, 6, 7, 8, 8, 9, 8, 8, 7, 6, 6, 7, 6, 6, 5, 4, 4, 3, 2, 2, 1, 0, 0, 1, 0, 0, 1, 2, 2, 3, 2, 2, 1, 0, 0, 1, 0, 0, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 6, 6, 7, 8, 8, 9, 10, 10, 11, 12
OFFSET
0,7
COMMENTS
Coordinates are given on a hexagonal lattice with X-axis and Y-axis as follows:
Y
/
/
0 ---- X
FORMULA
a(n) = 0 iff n belongs to A332206.
EXAMPLE
The Koch curve starts (on a hexagonal lattice) as follows:
. . . . . . + . . . . . .
/8\
. . . . +---+ +---+ . . . .
6\ 7 9 /10
. . . + . + . + . + . . .
/2\ /5 \ / \
. +---+ +---+ . . +---+ +---+ .
0 1 3 4 12 13 15 16
Hence, a(6) = a(7) = a(9) = a(10) = 2.
PROG
(PARI) { hex = [1, I, I-1, -1, -I, 1-I]; z=0; for (n=0, 84, print1 (imag(z)", "); q=digits(n, 4); d=sum(k=1, #q, if (q[k]==1, +1, q[k]==2, -1, 0)); z+=hex[1+d%#hex]) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jun 03 2020
STATUS
approved