[go: up one dir, main page]

login
a(n) is the Y-coordinate of the n-th point of the Koch curve; sequence A335358 gives X-coordinates.
2

%I #14 Feb 07 2021 09:49:17

%S 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,

%T 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,

%U 3,4,4,5,6,6,7,6,6,7,8,8,9,10,10,11,12

%N a(n) is the Y-coordinate of the n-th point of the Koch curve; sequence A335358 gives X-coordinates.

%C Coordinates are given on a hexagonal lattice with X-axis and Y-axis as follows:

%C Y

%C /

%C /

%C 0 ---- X

%H Rémy Sigrist, <a href="/A335359/b335359.txt">Table of n, a(n) for n = 0..8192</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Koch_snowflake">Koch snowflake</a>

%H <a href="/index/Con#coordinates_2D_curves">Index entries for sequences related to coordinates of 2D curves</a>

%F a(n) = 0 iff n belongs to A332206.

%e The Koch curve starts (on a hexagonal lattice) as follows:

%e . . . . . . + . . . . . .

%e /8\

%e . . . . +---+ +---+ . . . .

%e 6\ 7 9 /10

%e . . . + . + . + . + . . .

%e /2\ /5 \ / \

%e . +---+ +---+ . . +---+ +---+ .

%e 0 1 3 4 12 13 15 16

%e Hence, a(6) = a(7) = a(9) = a(10) = 2.

%o (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]) }

%Y Cf. A065359, A332206, A335358.

%K nonn,base

%O 0,7

%A _Rémy Sigrist_, Jun 03 2020