login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A336446
Squares visited by a chess queen moving on a square-spiral numbered board where the queen moves to an unvisited square containing the smallest prime number.
4
1, 2, 3, 5, 7, 19, 17, 13, 11, 23, 47, 43, 41, 37, 31, 29, 53, 127, 79, 73, 71, 67, 103, 101, 97, 61, 59, 131, 89, 83, 173, 167, 163, 157, 151, 107, 109, 271, 211, 199, 197, 193, 191, 139, 137, 239, 181, 179, 641, 457, 241, 251, 257, 263, 149, 397, 389, 313, 311, 307, 293, 113, 281
OFFSET
1,2
COMMENTS
This sequences gives the numbers of the squares visited by a chess queen moving on a square-spiral numbered board where the queen starts on the 1 numbered square and at each step moves to an unvisited square containing the smallest prime number. The movement is restricted to the eight directions a queen can move on a standard chess board, and the queen cannot move over a previously visited square. Note that if the queen simply moves to an unvisited square containing the smallest number the sequence will be infinite as the queen will just follow the square spiral path.
The sequence is finite. After 5880 steps the square with number 55903 is visited, after which all eight squares the queen can move to have been visited.
The first term where this sequence differs from A336402, where the queen steps to the closest unvisited prime, is a(4) = 5. See the examples below.
The largest visited square is a(4943) = 79187. The largest step distance between visited squares is 72 units, between a(3205) = 31397 to a(3206) = 31469. The largest prime gap between visited squares is 30150, from a(4942) = 49037 to a(4943) = 79187. The smallest unvisited prime is 45833.
LINKS
Scott R. Shannon, Image showing the 5880 steps of the queen's path. A green square shows the starting 1 square, a red square, above the bottom-left corner, shows the final square with number 55903, and a thick white line is the path between visited squares. All visited prime numbered squares are shown in yellow, while those unvisited squares containing primes are shown in grey. The eight squares which block the queen's movement from the final square are shown with a red border. The square spiral numbering of the board is shown as a thin white line. Click on the image to zoom in to see the prime numbers.
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 queen.
a(2) = 2. The seven unvisited prime numbered squares around a(1) the queen can move to are numbered 2,3,61,5,19,7,23. Of these 2 is the smallest. There are no primes in the south-east direction from a(1).
a(4) = 5. The four unvisited prime numbered squares around a(3) = 3 the queen can move to are numbered 11,29,13,5, the other two available directions not having any primes. Of these 5 is the smallest. Note that 11 is the closest prime, being only sqrt(2) units away while 5 is 2 units away.
a(4943) = 79187. This is only unvisited square containing a prime number around a(4942) = 49037. It is 30 units away to the right.
KEYWORD
nonn,walk,fini,full
AUTHOR
Scott R. Shannon, Jul 22 2020
STATUS
approved