OFFSET
1,2
COMMENTS
This is a variation of A316667. The same knight move rules apply, but at each step the knight cannot move in the same direction as its previous step.
The sequence is finite. After 217 steps the square with spiral number 118 is reached after which all surrounding squares have been visited.
The first term where this sequence differs from A316667 is a(19) = 49. The previous step was from a(17) = 27 to a(18) = 24, a step 1 unit down and 2 units to the left. The minimum unvisited spiral number one knight leap away from 24 is 45, but that is also in a direction 1 unit down and 2 units to the left, so cannot be chosen. The next closest unvisited square is 49, 1 unit down and 2 units to the right.
LINKS
Scott R. Shannon, Table of n, a(n) for n = 1..218
Scott R. Shannon, Image showing the 217 steps of the knight's path. The green dot is the first square with number 1 and the red dot the last square with number 118. The red dot is surrounded by blue dots to show the eight occupied squares. The yellow dots marks the smallest unvisited square with number 145.
N. J. A. Sloane and Brady Haran, The Trapped Knight, Numberphile video (2019).
EXAMPLE
The board is numbered with the square spiral:
.
17--16--15--14--13 .
| | .
18 5---4---3 12 29
| | | | |
19 6 1---2 11 28
| | | |
20 7---8---9--10 27
| |
21--22--23--24--25--26
.
a(1) = 1, the starting square of the knight.
a(2) = 10. The eight unvisited squares one knight leap away from a(1) are numbered 10,12,14,16,18,20,22,24. Of these 10 is the lowest.
a(19) = 49. The four unvisited squares one knight leap away from a(18) = 24 are numbered 45,49,77,79. Of these 45 is the lowest but that would require a step 1 unit down and 2 units left from 24, which is the same step as a(17) = 27 to a(18) = 24, so is not allowed. The next lowest available square is 49.
CROSSREFS
KEYWORD
nonn,fini,full,walk
AUTHOR
Scott R. Shannon, Jul 12 2020
STATUS
approved