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-3 of 3 results.

A329520 a(n) is the number of completed steps before being trapped for a knight moving on a square-spiral numbered board where the knight moves to an unvisited square with the lowest spiral number and with n or fewer visited neighbors. It only moves to squares with n+1 or more visited neighbors when no other squares are available, and if two or more such squares are present it chooses the square with the fewest visited neighbors, then the square with the lowest spiral number if still tied.

Original entry on oeis.org

1151, 225, 1866, 513316, 11171, 3935788, 23014, 2015
Offset: 1

Views

Author

Scott R. Shannon, Nov 19 2019

Keywords

Comments

This sequence gives the number of completed steps for a knight before being trapped when moving on a square-spiral numbered board and at each step choosing an unvisited square one knight-leap away which has the lowest spiral number and has n or fewer visited neighboring squares. It will only move to a square with n+1 or more neighbors when no square with n or fewer neighbors is available. If it is forced to move to such squares and two or more are available, it will choose the square with the fewest neighbors. If two or more squares with the same number of neighbors exist then it will choose the square with the smallest spiral number.
For n = 8 the path is equivalent to that given in A316667. Every square will always have eight or fewer visited neighbors, thus all unvisited squares are available to move to and the one with the smallest spiral number will always be chosen. This is A316667.
The values are surprisingly diverse, and it is not immediately obvious that the smaller values of n will even have a finite path length. It seems reasonable to assume that with the knight always choosing squares with very few visited neighbors it would be constantly moving away from the origin and thus never be trapped. But the path taken shows that, with such a restrictive choice of neighboring squares, the path leaves large areas of unvisited squares as the knight moves around the board, some of these being relatively close to the origin. At some point the knight will have an open path and move to these squares, thus move toward the origin, due to its preference to choose the squares with the smallest spiral number. It is thus drawn inward where it will then be surrounded by previous visited squares and eventually trapped. This tendency to leave large areas of unvisited squares is most easily seen in the path for n = 2, see link below, which is trapped after only 225 steps.
On the other extreme the path for n = 6, see A329519, is such that very few open areas remain near the origin, but the knight is still cautious in its choice and will not move to a square where it will likely be trapped, unless no other choices exist. This leads to the knight performing an extremely long walk before eventually finding a gap in its previous paths, moving toward the origin and finally being trapped after 3935788 steps.

Examples

			a(6) = 3935788. See A329519.
a(7) = 23014. See A329518.
a(8) = 2015. See A316667.
See A316667 for the spiral board numbering.
		

Crossrefs

A329519 Squares visited by a knight moving on a square-spiral numbered board where the knight moves to an unvisited square with the lowest spiral number and with six or fewer visited neighbors. It only moves to squares with seven or more visited neighbors when no other square is available; if two or more such squares are present it chooses the square with the fewest neighbors, then the square with the lowest spiral number if still tied.

Original entry on oeis.org

1, 10, 3, 6, 9, 4, 7, 2, 5, 8, 11, 14, 29, 32, 15, 12, 27, 24, 45, 20, 23, 44, 41, 18, 35, 38, 19, 16, 33, 30, 53, 26, 47, 22, 43, 70, 21, 40, 17, 34, 13, 28, 25, 46, 75, 42, 69, 104, 37, 62, 95, 58, 55, 86, 51, 48, 77, 114, 73, 108, 151, 68, 103, 64, 67, 36
Offset: 1

Views

Author

Scott R. Shannon, Nov 18 2019

Keywords

Comments

This is a variation of A316667. The same knight move rules apply, but the knight will not move to a square which has seven or eight visited neighbors unless no other square is available. If the only unvisited squares available to move to have seven or eight neighbors it will choose the one with the lowest number of neighbors first, and if a tie still exists it will choose the one with the smallest spiral number.
The sequence is finite. After 3935788 steps the square with spiral number 3352743 is reached after which all surrounding squares have been visited. This is the longest possible path using the given knight-leap rules for the eight possible values of visited neighbor count. A329520 gives the other path lengths.
The sequences matches the values of A316667 for the first 332 terms, but on the 332nd step the knight sees that square 193 has seven visited neighbors and thus chooses square 393 instead. Along its path the knight encounters 38812 squares where it would have chosen a square with seven or eight neighbors if only the lowest spiral number was considered; 21897 squares had seven neighbors, 16915 squares had eight neighbors. Of those squares thirteen times a square with seven neighbors was actually chosen due to no other square with a lower neighbor count being available. The first such encounter is after 380990 steps while on the square with number 295910. On this first encounter a square with eight neighbors is also available, and has a lower board number than the square with seven neighbors. Thus if the rules were changed to always select the lowest board number regardless of the number of neighbors in such cases then the knight would choose the eight-neighbor square and thus be trapped after 380990 steps.
Due to the knight's avoidance of trapping or potentially trapping squares numerous squares which are inside the knight's overall path are never visited; the first such example is square 193 mentioned above. This is in contrast to standard knight's tours which typically cover all internal squares.

Examples

			See A316667 for the spiral board numbering.
		

Crossrefs

A330189 Squares visited by a knight moving on a square-spiral numbered board where the knight moves to the unvisited square with the fewest visited neighbors. In case of a tie it chooses the square with the lowest spiral number.

Original entry on oeis.org

1, 10, 3, 6, 9, 4, 7, 2, 25, 50, 79, 116, 45, 74, 71, 106, 67, 36, 61, 94, 31, 54, 89, 128, 175, 84, 81, 118, 163, 76, 113, 72, 107, 68, 37, 62, 95, 136, 59, 56, 87, 126, 83, 172, 169, 82, 171, 224, 285, 354, 431, 516, 349, 426, 275, 210, 213, 112, 157, 208, 267, 334, 263, 200, 101, 66, 63, 38, 65, 144, 193, 250, 315, 246, 137, 186, 133, 238, 183, 134, 181
Offset: 1

Views

Author

Scott R. Shannon (following a suggestion by M. F. Hasler), Dec 04 2019

Keywords

Comments

This sequences gives the numbers of the squares visited by a knight moving on a square-spiral numbered board, as described in A316667, where at each step the knight goes to the neighbor one knight-leap away which has the fewest visited neighbors. If two or more neighbors exist with the same lowest neighbor count then, from that list of squares, the square with the lowest spiral number is chosen.
The sequence is finite. After 656 steps the square with number 273 is visited, after which all neighboring squares have been visited.
The first step where the knight has only one neighbor to choose from in the list of neighboring squares with the fewest visited neighbors is at step 39 where only neighboring square 56 has one visited neighbor. The first step where the neighboring squares all have two or more visited neighbors is at step 146 where neighboring squares 443, 533, and 535 all have two visited neighbors.
Like the walks in A329520 it is not immediately obvious that this will be a finite walk as one may believe the knight would be constantly moving away from the origin and thus never be trapped. But like in those walks, the knight here leaves gaps in its path as it moves away from the origin, which will subsequently be visited due to the knight's preference of choosing the square with the smallest spiral number when two or more squares with the same neighbor count are encountered. This draws the knight toward the origin where it will eventually be trapped.

Examples

			See A316667 for the spiral board numbering.
		

Crossrefs

Showing 1-3 of 3 results.