OFFSET
1,2
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 contains the number with the fewest divisors. If two or more neighbors exist with the same fewest number of divisors then the square with the lowest spiral number is chosen.
The sequence is finite. After 528 steps the square with number 33 is visited, after which all neighboring squares have been visited.
Due to the knight's preference for squares with the fewest divisors the knight will leap to a prime numbered square when possible, and the lowest prime if two or more unvisited primes are within one knight-leap. Therefore this sequence matches A330008 for the first 13 terms, but on the 13th step the square with number 86 is chosen as no primes are available and 86 has only four divisors, while A330008 chooses 32, the smallest available number, but which has six divisors.
Of the 528 visited squares 198 contain prime numbers while 330 contain composites. The largest visited square is a(410) = 3656.
LINKS
Scott R. Shannon, Table of n, a(n) for n = 1..529
Scott R. Shannon, Image showing the 528 steps of the knight's path. A green dot marks the starting 1 square and a red dot the final square with number 33. The red dot is surrounded by eight blue dots to show the occupied neighboring squares. A yellow dots marks the smallest unvisited square with number 21.
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 knight.
a(2) = 10. The eight unvisited squares the knight can leap to from a(1) are numbered 10,12,14,16,18,20,22,24. Of these 10,14,22 have the minimum four divisors, and of those 10 is the smallest.
CROSSREFS
KEYWORD
nonn,fini,full,walk
AUTHOR
Scott R. Shannon, Jun 26 2020
STATUS
approved