OFFSET
1,2
COMMENTS
A fairy chess wazir can move one step in each of the four orthogonal grid directions, i.e., the same directions as a chess rook but only one square. In this sequence the wazir moves to the closest unvisited neighboring square which contains the number with the fewest divisors, and in case of a tie the square with the lowest spiral number. Note that if the wazir simply moves to the lowest available number the sequence will be infinite as the wazir will just follow the square spiral path.
The sequence is finite. After 61 steps the square with number 276 is visited, after which all four neighboring squares have been visited.
Due to the wazir's preference for squares with the fewest divisors it will move to a prime numbered square when possible, and the lowest prime if two or more unvisited primes are in neighboring squares. Of the 61 visited squares, 21 contain prime numbers, while 40 contain composites. The largest visited square is a(51) = 515.
LINKS
Scott R. Shannon, Image showing the 61 steps of the wazir's path. A green dot marks the starting 1 square and a red dot the final square with number 276. The red dot is surrounded by four blue dots to show the unavailable neighboring squares. A yellow dot marks the smallest unvisited square with number 9.
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 for the wazir.
a(2) = 2. The four unvisited squares around a(1) to which the wazir can move are numbered 2,4,6,8. Of these, 2 has only two divisors, so it is the square chosen.
a(9) = 23. The two unvisited squares around a(8) = 8 to which the wazir can move are numbered 9 and 23. Of these, 23 has only two divisors, so it is the square chosen.
CROSSREFS
KEYWORD
nonn,walk,fini,full
AUTHOR
Scott R. Shannon, Jun 29 2020
STATUS
approved