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-3 of 3 results.

A362027 Squares visited by a knight moving on a square-spiral numbered board where the knight moves to a previously unvisited square with a number as close as possible to the number of the current square. If two such squares exist the smaller numbered square is chosen.

Original entry on oeis.org

1, 10, 3, 6, 9, 12, 15, 18, 7, 4, 11, 8, 5, 2, 13, 28, 25, 46, 21, 40, 17, 34, 59, 56, 29, 32, 55, 58, 33, 30, 53, 26, 47, 22, 19, 16, 37, 62, 95, 136, 91, 130, 87, 52, 49, 24, 27, 48, 51, 80, 83, 120, 123, 84, 81, 118, 77, 44, 41, 68, 103, 100, 63, 66, 39, 36, 61, 94, 57, 88, 127, 174, 229, 170
Offset: 1

Views

Author

Scott R. Shannon, Apr 05 2023

Keywords

Comments

This sequence is finite: after 130 squares have been visited the square with number 50 is reached after which all eight neighboring squares the knight could move to have already been visited. See the linked image. The largest visited square is a(117) = 247 while the smallest unvisited square is 20.

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(6) = 12 as after the knight moves to the square containing 9 the available unvisited squares are 4, 12, 22, 26, 28, 46, 48. Of these 12, where |12 - 9| = 3, is the closest number to 9. This is the first term to differ from A316667.
		

Crossrefs

A377015 Squares visited by a knight moving on a square-spiral numbered board where the knight moves to a square which has been previously visited the fewest number of times. If two or more such squares exist the smallest numbered square is chosen.

Original entry on oeis.org

1, 10, 3, 6, 9, 4, 7, 2, 5, 8, 11, 14, 29, 32, 15, 12, 27, 24, 45, 20, 23, 44, 41, 18, 35, 38, 19, 16, 33, 30, 53, 26, 47, 22, 43, 70, 21, 40, 17, 34, 13, 28, 25, 46, 75, 42, 69, 104, 37, 62, 95, 58, 55, 86, 51, 48, 77, 114, 73, 108, 151, 68, 103, 64, 67, 36, 39, 66, 63, 96, 59, 56, 87, 52, 49, 78, 115, 74, 71, 106, 149, 102, 99, 140, 61, 94, 31, 54, 85, 50
Offset: 1

Views

Author

Scott R. Shannon, Nov 09 2024

Keywords

Comments

Unlike similar sequences, e.g. A316667, A362027, A326922, in this variation the knight is never trapped as it can always move to the square which has been previously visited the fewest times, or if two or more surrounding squares exist with the same smallest previous visit count, then it can move to the smallest numbered square of these options.
The first 2016 terms are the same as A316667. In that sequence the path now ends, but here, as the knight is now surrounded by eight squares that have all been visited once, it now chooses the smallest numbered available square, 1733 in this case. This eventually leads it back toward the origin where it revisits the 1 starting square at a(2039). From here it once again chooses the surrounding square with the fewest previous visits, so it begins a new path, but it will avoid the path it previously took back to the origin since those squares will have two previous visits.
The above pattern repeats, causing the knight to go on various excursions of generally increasing length before it revisits the origin - see A377928 for the indices where a(n) = 1. The knight eventually tours paths of increasing complexity, in general moving along distorted loops which are defined by the previous visit count, with straight path lines between these loops. See the attached images.
Interestingly some of the paths between origin visits are identical; for example the path between the 2nd and 3rd visits to the origin is the same as that between the 32nd and 33rd visits. Likewise those between the 5th-6th and 23rd-24th, and 37th-38th and 40th-41st are the same.

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 default starting square.
a(2) = 10 as all eight surrounding available squares, 10, 12, 14, 16, 18, 20, 22, 24 have zero previous visits, so it chooses the smallest number of those, namely 10.
a(3) = 3 as there are seven available squares that have zero previous visits, and of those 3 is the smallest number. Note the 1 square is not considered as that has one previous visit which is more than the other seven squares.
a(2017) = 1733 as all eight surrounding available squares have been visit once, so it chooses the smallest number of those, namely 1733. This is the first term to differ from A316667.
		

Crossrefs

A377928 The indices k where A377015(k) = 1.

Original entry on oeis.org

1, 2039, 2703, 30083, 32155, 32437, 86925, 292101, 339137, 430611, 669371, 670563, 727051, 1161819, 1534325, 1541819, 1543011, 2027935, 2718001, 3266661, 3273829, 3730467, 4805861, 4806143, 5534871, 6371063, 7834735, 8926025, 9293575, 9664815, 12629449, 13645059, 13645723, 16510691, 19947389, 19952425, 22519739, 22520381, 24820941, 26657853, 26658495
Offset: 1

Views

Author

Scott R. Shannon, Nov 11 2024

Keywords

Comments

These are the indices where a knight moving on a square spiral revisits the origin using the path rules given in A377015. See that sequence for further details.

Crossrefs

Showing 1-3 of 3 results.