cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jun 03 2020

Keywords

Comments

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

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.
		

Crossrefs

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.