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.

A336447 Squares visited by a chess rook moving on a square-spiral numbered board where the rook moves to an unvisited square containing the smallest prime number.

Original entry on oeis.org

1, 2, 3, 5, 7, 41, 37, 31, 29, 521, 509, 337, 109, 43, 47, 83, 89, 179, 173, 359, 353, 349, 113, 293, 307, 311, 313, 317, 191, 97, 101, 103, 107, 691, 683, 197, 193, 1429, 1427, 887, 883, 661, 659, 653, 463, 461, 457, 181, 467, 479, 1163, 1171, 331, 673, 677, 1153, 1151, 487, 491, 199
Offset: 1

Views

Author

Scott R. Shannon, Jul 22 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 an unvisited square containing the smallest 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. Note that if the rook simply moves to an unvisited square containing the smallest number the sequence will be infinite as the rook will just follow the square spiral path.
The sequence is finite. After 134 steps the square with number 863 is visited, after which all four squares the rook can move to have been visited.
The first term where this sequence differs from A336413, where the rook steps to the closest unvisited prime, is a(7) = 37. See the examples below.
The largest visited square is a(102) = 3739. The largest step distance between visited squares is 24 units, between a(128) = 2179 to a(129) = 2203. The largest prime gap between visited squares is 2646, from a(101) = 1093 to a(102) = 3739. 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 smallest.
a(7) = 37. The three unvisited prime numbered squares around a(6) = 41 the rook can move to are numbered 37,43,107. Of those 37 is the smallest. Note that 43 is the closest prime, being only 2 units away while 37 is 4 units away.
a(135) = 863. The final square. The three previously visited prime numbered squares around a(135) are numbered 191,859,1709. Note there is no fourth prime as the column of squares directly upward from 863 contains no primes; the values from 871,994,1125,... and beyond fit the quadratic 4n^2+119n+871, which can be factored as (4n+67)*(n+13), and thus contains no primes.
		

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.