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.

Showing 1-8 of 8 results.

A068608 Path of a knight's tour on an infinite chessboard.

Original entry on oeis.org

1, 10, 3, 16, 19, 22, 9, 12, 15, 18, 7, 24, 11, 14, 5, 20, 23, 2, 13, 4, 17, 6, 21, 8, 25, 50, 27, 54, 31, 60, 35, 64, 67, 40, 71, 74, 45, 78, 49, 52, 29, 56, 59, 34, 63, 66, 39, 70, 43, 76, 47, 80, 51, 28, 55, 58, 33, 62, 37, 68
Offset: 0

Views

Author

Hans Secelle and Albrecht Heeffer (albrecht.heeffer(AT)pandora.be), Mar 09 2002

Keywords

Comments

One of eight possible knight's tours. Squares are numbered in a clockwise spiral. Enumerates all positive integers.
A description of the method to construct the tour is provided in A306659. - Hugo Pfoertner, May 11 2019

Crossrefs

Programs

  • PARI
    \\Ellermann's clockwise square spiral, first step (0,0) -> (0,1)
    y=vector(10000);L=0;d=1;n=0;
    for(r=1, 100, d=-d; k=floor(r/2)*d; for(j=1, L++, y[n++]=k); forstep(j=k-d, -floor((r+1)/2)*d+d, -d, y[n++]=j));
    x=vector(10100);L=1;d=-1;n=0;
    for(r=1, 100, d=-d; k=floor(r/2)*d; for(j=1, L++, x[n++]=-k); forstep(j=k-d, -floor((r+1)/2)*d+d, -d, x[n++]=-j));
    \\ Position in spiral
    findpos(i,j)={my(size=(2*max(abs(i),abs(j))+1)^2);forstep(k=size,1,-1, if(i==x[k]&&j==y[k], return(k)))};
    atan2(y,x)=if(x>0,atan(y/x),if(x==0,if(y>0,Pi/2,-Pi/2),if(y>=0,atan(y/x)+Pi,atan(y/x)-Pi)));
    angle(v,w)=atan2(v[1]*w[2]-v[2]*w[1],v[1]*w[1]+v[2]*w[2]);
    move=[2,1;1,2;-1,2;-2,1;-2,-1;-1,-2;1,-2;2,-1]; \\ 8 Knight moves
    m=6;b=matrix(2*m+1, 2*m+1, i, j, 0);setb(pos)={b[pos[1]+m+1, pos[2]+m+1]=1};
    getb(pos)=b[pos[1]+m+1, pos[2]+m+1];
    inring(n, p)=!(abs(p[1])angmin, jmin=j; angmin=adiff;jlast=j)))));if(jmin>0,p+=move[jmin,];setb(p);););p+=move[jlast,];setb(p)); \\ Hugo Pfoertner, May 11 2019

A068613 Path of a knight's tour on an infinite chessboard.

Original entry on oeis.org

1, 24, 7, 18, 15, 12, 9, 22, 19, 16, 3, 10, 23, 20, 5, 14, 11, 8, 21, 6, 17, 4, 13, 2, 25, 80, 47, 76, 43, 70, 39, 66, 63, 34, 59, 56, 29, 52, 49, 78, 45, 74, 71, 40, 67, 64, 35, 60, 31, 54, 27, 50, 79, 46, 75, 72, 41, 68, 37, 62
Offset: 0

Views

Author

Hans Secelle and Albrecht Heeffer (albrecht.heeffer(AT)pandora.be), Mar 09 2002

Keywords

Comments

One of eight possible knight's tours. Squares are numbered in a clockwise spiral. Enumerates all positive integers.

Crossrefs

A068610 Path of a knight's tour on an infinite chessboard.

Original entry on oeis.org

1, 18, 7, 24, 11, 14, 5, 20, 23, 10, 3, 16, 19, 22, 9, 12, 15, 6, 21, 8, 25, 2, 13, 4, 17, 66, 39, 70, 43, 76, 47, 80, 51, 28, 55, 58, 33, 62, 37, 68, 41, 72, 75, 46, 79, 50, 27, 54, 31, 60, 35, 64, 67, 40, 71, 74, 45, 78, 49, 52
Offset: 0

Views

Author

Hans Secelle and Albrecht Heeffer (albrecht.heeffer(AT)pandora.be), Mar 09 2002

Keywords

Comments

One of eight possible knight's tours. Squares are numbered in a clockwise spiral. Enumerates all positive integers.

Crossrefs

A068609 Path of a knight's tour on an infinite chessboard.

Original entry on oeis.org

1, 14, 5, 20, 23, 10, 3, 16, 19, 22, 9, 12, 15, 18, 7, 24, 11, 4, 17, 6, 21, 8, 25, 2, 13, 58, 33, 62, 37, 68, 41, 72, 75, 46, 79, 50, 27, 54, 31, 60, 35, 64, 67, 40, 71, 74, 45, 78, 49, 52, 29, 56, 59, 34, 63, 66, 39, 70, 43, 76
Offset: 0

Views

Author

Hans Secelle and Albrecht Heeffer (albrecht.heeffer(AT)pandora.be), Mar 09 2002

Keywords

Comments

One of eight possible knight's tours. Squares are numbered in a clockwise spiral. Enumerates all positive integers.

Crossrefs

Extensions

a(56), which had been shown as 37, corrected to 39 by Kevin Ryde, Jan 17 2012

A068611 Path of a knight's tour on an infinite chessboard.

Original entry on oeis.org

1, 22, 9, 12, 15, 18, 7, 24, 11, 14, 5, 20, 23, 10, 3, 16, 19, 8, 25, 2, 13, 4, 17, 6, 21, 74, 45, 78, 49, 52, 29, 56, 59, 34, 63, 66, 39, 70, 43, 76, 47, 80, 51, 28, 55, 58, 33, 62, 37, 68, 41, 72, 75, 46, 79, 50, 27, 54, 31, 60
Offset: 0

Views

Author

Hans Secelle and Albrecht Heeffer (albrecht.heeffer(AT)pandora.be), Mar 09 2002

Keywords

Comments

One of eight possible knight's tours. Squares are numbered in a clockwise spiral. Enumerates all positive integers.

Crossrefs

A068614 Path of a knight's tour on an infinite chessboard.

Original entry on oeis.org

1, 12, 9, 22, 19, 16, 3, 10, 23, 20, 5, 14, 11, 24, 7, 18, 15, 2, 25, 8, 21, 6, 17, 4, 13, 56, 29, 52, 49, 78, 45, 74, 71, 40, 67, 64, 35, 60, 31, 54, 27, 50, 79, 46, 75, 72, 41, 68, 37, 62, 33, 58, 55, 28, 51, 80, 47, 76, 43, 70
Offset: 0

Views

Author

Hans Secelle and Albrecht Heeffer (albrecht.heeffer(AT)pandora.be), Mar 09 2002

Keywords

Comments

One of eight possible knight's tours. Squares are numbered in a clockwise spiral. Enumerates all positive integers.

Crossrefs

A068615 Path of a knight's tour on an infinite chessboard.

Original entry on oeis.org

1, 16, 3, 10, 23, 20, 5, 14, 11, 24, 7, 18, 15, 12, 9, 22, 19, 4, 13, 2, 25, 8, 21, 6, 17, 64, 35, 60, 31, 54, 27, 50, 79, 46, 75, 72, 41, 68, 37, 62, 33, 58, 55, 28, 51, 80, 47, 76, 43, 70, 39, 66, 63, 34, 59, 56, 29, 52, 49, 78
Offset: 0

Views

Author

Hans Secelle and Albrecht Heeffer (albrecht.heeffer(AT)pandora.be), Mar 09 2002

Keywords

Comments

One of eight possible knight's tours. Squares are numbered in a clockwise spiral. Enumerates all positive integers.

Crossrefs

A306659 x-coordinates of a counterclockwise knight's tour on an infinite board starting at the origin and then successively visiting fields in concentric rings of width 2. y-coordinates are in A306660.

Original entry on oeis.org

0, 2, 0, -2, -1, 1, 2, 1, -1, -2, 0, 2, 1, -1, -2, -1, 1, 0, -2, -1, -2, 0, 2, 1, 2, 3, 1, -1, -3, -4, -3, -4, -2, 0, 2, 4, 3, 4, 3, 1, -1, -3, -4, -3, -4, -3, -1, 1, 3, 4, 3, 4, 2, 0, -2, -4, -3, -4, -3, -1, 1, 3, 4, 3, 4, 2, 0, -2, -4, -3, -4, -3, -4, -2, 0
Offset: 1

Views

Author

Hugo Pfoertner, May 05 2019

Keywords

Comments

The tour starts with a prescribed initial move (0,0) -> (2,1). It then proceeds to the next field (x,y) not yet visited, satisfying the "ring" conditions
!(abs(x) < liminn and abs(y) < liminn) and abs(x) <= limout and abs(y) <= limout, with liminn=1, limout=2 in the first round, liminn=3, limout=4 in the second round, liminn=5, limout=6 in the third round, ...
Each move is selected from the list of the 8 possible moves, such that the angular difference between the polar angles of the starting point and the target point achieves the minimum of the available positive values. This guarantees the counterclockwise advancing of the tour.
When all fields inside a ring have been visited, an extension step continuing the last used direction inside the preceding inner ring is performed, thus establishing the first visited field in the next ring.
The selection method continues by successively visiting fields in the current ring until no more free fields are available.
A similar method of construction is used in A068608 and its 7 companion sequences. In contrast to the present sequence, initial steps are chosen such that the extension steps are parallel to the initial step. Clockwise advancement is used in A068608-A068611, counterclockwise advancement is used in A068612-A068615. The tour's visited fields are then mapped to a clockwise square number spiral starting with number 1 for the origin and first step to (0,1).

Crossrefs

Programs

  • PARI
    atan2(y,x)=if(x>0,atan(y/x),if(x==0,if(y>0,Pi/2,-Pi/2),if(y>=0,atan(y/x)+Pi,atan(y/x)-Pi)));
    angle(v,w)=atan2(v[1]*w[2]-v[2]*w[1],v[1]*w[1]+v[2]*w[2]);
    move=[2,1;1,2;-1,2;-2,1;-2,-1;-1,-2;1,-2;2,-1]; \\ 8 Knight moves
    m=6; \\ Extension of board - 2
    b=matrix(2*m+1,2*m+1,i,j,0); \\ Visited fields
    ptarget=1; \\ change to 2 to print A306660
    setb(pos)={b[pos[1]+m+1,pos[2]+m+1]=1}; \\ Mark visited fields
    getb(pos)=b[pos[1]+m+1,pos[2]+m+1]; \\ Check visited fields
    inring(n,p)=!(abs(p[1])=0,if(adiff0,p+=move[jmin,];setb(p);););p+=move[jlast,];setb(p));
Showing 1-8 of 8 results.