OFFSET
0,9
COMMENTS
This is a variation of sequence A326413 where, instead of taking the lowest x-coordinate of the two tied squares with the same board number and distance from the origin, the square is chosen which is to the left of a line, from the point-of-view of the knight looking toward the origin, drawn between the knight's current position and the 0-squared origin. Due to the two tied points being equidistant from the origin these two point will always be on opposite sides of this line, thus this choice is always unambiguous.
The sequence is finite as after 1209 steps a square with the number 9, with coordinates (-11,6) relative to the origin, is reached after which all eight surrounded squares have been visited.
LINKS
Scott R. Shannon, Image showing the path of the 1209 steps. The starting square is shown in green, and final square in red. The eight blocking squares are shown in blue. Each of the yellow squares are where the next step was decided from two tied squares by choosing the point left of the line between the current position and the origin; the pink square shows the chosen left square, and a gray square the ignored right square.
N. J. A. Sloane and Brady Haran, The Trapped Knight, Numberphile video (2019).
EXAMPLE
The digit-square spiral is
.
.
2---2---2---1---2---0---2 2
| | |
3 1---2---1---1---1 9 3
| | | | |
2 3 4---3---2 0 1 1
| | | | | | |
4 1 5 0---1 1 8 3
| | | | | |
2 4 6---7---8---9 1 0
| | | |
5 1---5---1---6---1---7 3
| |
2---6---2---7---2---8---2---9
.
CROSSREFS
KEYWORD
nonn,fini,walk
AUTHOR
Scott R. Shannon, Nov 06 2019
STATUS
approved