cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-4 of 4 results.

A336413 Squares visited by a chess rook moving on a square-spiral numbered board where the rook moves to the closest unvisited square containing a prime number. In case of a tie it chooses the square with the smallest prime number.

Original entry on oeis.org

1, 2, 3, 5, 7, 41, 43, 109, 107, 103, 37, 193, 191, 97, 101, 199, 197, 683, 677, 673, 1753, 1747, 1429, 1427, 887, 883, 661, 659, 881, 877, 307, 461, 463, 653, 1129, 1733, 2083, 2081, 3323, 3319, 3797, 3793, 5419, 5417, 5413, 4297, 2861, 2857, 2447, 2069, 1723, 1721, 1409, 1123, 1117, 1399
Offset: 1

Views

Author

Scott R. Shannon, Jul 21 2020

Keywords

Comments

This sequences gives the numbers of the squares visited by a chess rook moving on a square-spiral numbered board where the rook starts on the 1 numbered square and at each step moves to the closest unvisited square containing a prime number. The movement is restricted to the four directions a rook can move on a standard chess board, and the rook cannot move over a previously visited square. If two or more unvisited prime numbered squares exist which are the same distance from the current square then the one with the smallest prime number is chosen. Note that if the rook simply moves to the closest unvisited square the sequence will be infinite as the rook will just follow the square spiral path.
The sequence is finite. After 350 steps the square with number 2179 is visited, after which all four squares the rook can move to have been visited.
The first term where this sequence differs from A336447, where the rook steps to the smallest unvisited prime, is a(7) = 43. See the examples below.
The largest visited square is a(151) = 30539. Both the largest step distance between visited squares, 24 units, and the largest prime gap between visited squares, 6744, occur between a(229) = 2143 and a(230) = 8887. The smallest unvisited prime is 11.

Examples

			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 rook.
a(2) = 2. The four unvisited prime numbered squares around a(1) the rook can move to are numbered 2,61,19,23. Of these 2 is the closest, being 1 unit away.
a(3) = 3. The three unvisited prime numbered squares around a(2) = 2 the rook can move to are numbered 47,11,3. Both 11 and 3 are 1 units away, and of those 3 is the smallest.
a(7) = 43. The three unvisited prime numbered squares around a(6) = 41 the rook can move to are numbered 37,43,107. Both 43 and 107 are 2 units away, and of those 43 is the smallest. Note that 37, the smallest available prime, is 4 units away.
a(230) = 8887. There is only one unvisited prime numbered square around a(229) = 2143 the rook can move to. The square 8887 is 24 units away to the left of 2143.
		

Crossrefs

A336402 Squares visited by a chess queen moving on a square-spiral numbered board where the queen moves to the closest unvisited square containing a prime number. In case of a tie it chooses the square with the smallest prime number.

Original entry on oeis.org

1, 2, 3, 11, 29, 13, 31, 59, 61, 97, 139, 191, 251, 193, 101, 103, 67, 37, 17, 5, 19, 7, 23, 47, 79, 163, 281, 353, 283, 433, 521, 617, 523, 619, 439, 359, 223, 167, 227, 293, 229, 173, 83, 233, 127, 53, 179, 131, 89, 137, 389, 313, 311, 467, 383, 307, 241, 239, 181, 457, 547, 643
Offset: 1

Views

Author

Scott R. Shannon, Jul 20 2020

Keywords

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 the closest unvisited square containing a 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 If two or more unvisited prime numbered squares exist which are the same distance from the current square then the one with the smallest prime number is chosen. Note that if the queen simply moves to the closest unvisited square the sequence will be infinite as the queen will just follow the square spiral path.
The sequence is finite. After 519 steps the square with number 1289 is visited, after which all eight squares the queen can move to have been visited.
The first term where this sequence differs from A330979, which steps to the closest unvisited prime without any movement direction restrictions, is a(40) = 227. See the examples below.
The largest visited square is a(292) = 14843. The largest step distance between visited squares is 20 units, between a(338) = 2879 to a(339) = 3779. The largest prime gap between visited squares is 4050, from a(396) = 10667 to a(397) = 14717. The smallest unvisited prime is 41.

Examples

			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 closest, being 1 unit away. There are no primes in the south-east direction from a(1).
a(4) = 11. The four unvisited prime numbered squares around a(3) = 3 the queen can move to are numbered 11,29,13,5, the other two directions not having any primes. Both 11 and 13 are sqrt(2) units away, and of those 11 is the smallest.
a(40) = 227. The three unvisited prime numbered squares around a(39) = 167 the queen can move to are numbered 227,173,53, Of these 227 is the closest, being 4 units away. Note that the square with prime number 83 is only sqrt(10), about 3.16, units away but is at relative coordinates (1,3) to 167 so cannot be reach by the queen.
		

Crossrefs

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.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Jul 22 2020

Keywords

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.

Examples

			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.
		

Crossrefs

A337254 Squares visited by a rook moving on a spirally numbered board always to the lowest available unvisited square with a move length of the current square (in decimal) + 1.

Original entry on oeis.org

1, 11, 13, 15, 17, 19, 21, 23, 25, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 227, 229, 231, 233, 235, 237, 239, 241, 243, 245, 247, 249, 251
Offset: 1

Views

Author

Patrick Wienhöft, Aug 21 2020

Keywords

Comments

The rook may move over squares it has already visited, only the final square after a full move must not have been visited before.
As for A316667, the rook gets trapped as well. This happens after step 185 on square 118.
Rook movement on the square spiral is also considered in A336447 and A336413.
This is a variation of generalized knights, as in A323749, where here each move is a (x,0)-leaper but as opposed to A323749 the x changes depending on the current square rather than having a fixed size for each move.

Examples

			The rook starts on square a(1) = 1. Thus its available moves are of length len(1) + 1 = 2, possibly reaching squares 11, 15, 19 and 23. Since 11 is the smallest value, a(2) = 11. From there on, the next move must have length len(11) + 1 = 3, etc.
		

Crossrefs

Showing 1-4 of 4 results.