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.

A326922 Squares visited by a knight moving on a board with squares labeled with their squared distance from the origin and where the knight moves to the smallest labeled unvisited square; the smallest spiral number ordering is used if the distances are equal.

Original entry on oeis.org

0, 5, 2, 1, 2, 1, 2, 1, 2, 1, 4, 5, 10, 13, 4, 5, 10, 5, 10, 5, 4, 13, 10, 5, 10, 13, 4, 5, 10, 13, 16, 13, 10, 5, 16, 13, 20, 9, 8, 9, 8, 9, 8, 9, 8, 17, 18, 17, 26, 25, 20, 25, 10, 13, 16, 29, 18, 17, 26, 25, 20, 25, 20, 13, 16, 29, 18, 17, 26, 25, 20, 25, 40, 41, 34, 37, 50, 29, 18, 17, 26, 25, 20, 25, 20, 25, 26, 37, 34, 25, 26, 17, 34, 25, 26, 17, 34, 25, 20, 37
Offset: 0

Views

Author

Scott R. Shannon, Oct 21 2019

Keywords

Comments

This sequence uses the squared distance from the origin to label the squares. At each step the knight goes to an unvisited square with the smallest label; if there are two or more squares with the same label it then chooses the square with the smallest number if the board was numbered as a spiral, i.e., the smallest spiral numbered square as in A316667.
The sequence is finite. After 22325 steps a square with label 6885 (spiral number = 25984) is visited, after which all neighboring squares have been visited.
If one looks at the spiral number for the visited squares in this sequence one finds it is the same as A316667 for the first 34 steps. On the 35th step this sequence goes to a square with spiral number 77, which is 4 units from the origin, while A316667 goes to square 43, which is sqrt(18) (> 4) units from the origin.
Sequence A326924 gives the number of the square visited at the n-th move, which is at distance^2 a(n) from the origin, cf. formula. - M. F. Hasler, Oct 22 2019

Examples

			The squares are labeled using their squared distance from the origin:
.
    +----+----+----+----+----+----+----+
    | 18 | 13 | 10 |  9 | 10 | 13 | 18 |
    +----+----+----+----+----+----+----+
    | 13 |  8 |  5 |  4 |  5 |  8 | 13 |
    +----+----+----+----+----+----+----+
    | 10 |  5 |  2 |  1 |  2 |  5 | 10 |
    +----+----+----+----+----+----+----+
    |  9 |  4 |  1 |  0 |  1 |  4 |  9 |
    +----+----+----+----+----+----+----+
    | 10 |  5 |  2 |  1 |  2 |  5 | 10 |
    +----+----+----+----+----+----+----+
    | 13 |  8 |  5 |  4 |  5 |  8 | 13 |
    +----+----+----+----+----+----+----+
    | 18 | 13 | 10 |  9 | 10 | 13 | 18 |
    +----+----+----+----+----+----+----+
.
If the knight has a choice of two or more squares with the same label (same squared distance from the origin), then the square with the minimum spiral number, as shown in A316667, is chosen.
		

Crossrefs

Cf. A174344, A274923, A296030 (coordinates of the square number n).

Programs

Formula

a(n) = A174344(A326924(n))^2 + A274923(A326924(n))^2. - M. F. Hasler, Oct 22 2019