A335359 a(n) is the Y-coordinate of the n-th point of the Koch curve; sequence A335358 gives X-coordinates.
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
Examples
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.
Links
Programs
-
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]) }
Formula
a(n) = 0 iff n belongs to A332206.
Comments