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

A338289 Squares visited by the black knight when a white knight and a black knight are moving on a spirally numbered board, always to the lowest available unvisited square; white moves first.

Original entry on oeis.org

1, 12, 9, 4, 7, 18, 35, 14, 29, 32, 55, 28, 13, 34, 17, 40, 21, 46, 25, 50, 79, 26, 47, 76, 43, 70, 105, 148, 65, 98, 37, 62, 33, 30, 53, 84, 49, 52, 87, 56, 59, 92, 89, 58, 91, 130, 57, 88, 127, 174, 229, 122, 167, 82, 119, 78, 115, 160, 75, 72, 107, 150, 201, 104, 147, 144, 193, 140, 95, 136, 185, 132, 135, 184, 181
Offset: 1

Views

Author

Andrew Smith, Oct 20 2020

Keywords

Comments

Board is numbered with the square spiral:
17--16--15--14--13 .
| | .
18 5---4---3 12 .
| | | | .
19 6 1---2 11 .
| | | .
20 7---8---9--10 .
| .
21--22--23--24--25--26
Both knights start on square 1, white moves to the lowest unvisited square (10), black then moves to the lowest unvisited square (12) and so on...
This sequence is finite, on the black knight's 1879th step, square 4242 is visited, after which there are no unvisited squares within one knight move.
The sequences generated by 4 knights and 8 knights also produce new sequences not yet in the OEIS.

Crossrefs

A338290 Squares visited by either knight when a white knight and a black knight are moving on a spirally numbered board, always to the lowest available unvisited square; white moves first.

Original entry on oeis.org

1, 10, 12, 3, 9, 6, 4, 15, 7, 2, 18, 5, 35, 8, 14, 11, 29, 24, 32, 27, 55, 48, 28, 23, 13, 20, 34, 39, 17, 16, 40, 19, 21, 22, 46, 41, 25, 44, 50, 71, 79, 74, 26, 45, 47, 42, 76, 69, 43, 38, 70, 63, 105, 66, 148, 99, 65, 36, 98, 61, 37, 94, 62, 31, 33, 54, 30, 85, 53, 124, 84, 51
Offset: 1

Views

Author

Andrew Smith, Oct 20 2020

Keywords

Comments

Board is numbered with the square spiral:
17--16--15--14--13 .
| | .
18 5---4---3 12 .
| | | | .
19 6 1---2 11 .
| | | .
20 7---8---9--10 .
| .
21--22--23--24--25--26
Both knights start on square 1, white moves to the lowest unvisited square (10), black then moves to the lowest unvisited square (12) and so on...
This sequence is finite, on the 3758th move or the black knight's 1879th step, square 4242 is visited, after which white wins and the game is over.
The sequences generated by 4 knights and 8 knights also produce new sequences not yet in the OEIS.

Crossrefs

A342946 Squares visited by the white knight when a white knight and a black knight are moving on a diagonally numbered board, always to the lowest available unvisited square; white moves first.

Original entry on oeis.org

1, 8, 6, 2, 12, 16, 24, 19, 15, 34, 14, 21, 43, 20, 25, 17, 39, 29, 23, 32, 42, 35, 45, 53, 28, 54, 63, 73, 84, 50, 59, 47, 56, 69, 80, 92, 108, 95, 83, 72, 62, 75, 44, 55, 89, 101, 86, 98, 111, 125, 140, 94, 107, 121, 173, 156, 137, 122, 174, 157, 141, 126
Offset: 1

Views

Author

Andrew Smith, Mar 30 2021

Keywords

Comments

Board is numbered as follows:
1 2 4 7 11 16 .
3 5 8 12 17 .
6 9 13 18 .
10 14 19 .
15 20 .
21 .
.
Both knights start on square 1, white moves to the lowest unvisited square (8), black then moves to the lowest unvisited square (9) and so on...
This sequence is finite, on the white knight's 292nd step, square 406 is visited, after which there are no unvisited squares within one knight move.

Crossrefs

Programs

A342947 Squares visited by the black knight when a white knight and a black knight are moving on a diagonally numbered board, always to the lowest available unvisited square; white moves first.

Original entry on oeis.org

1, 9, 4, 3, 13, 7, 5, 10, 26, 18, 11, 30, 37, 48, 22, 31, 38, 46, 58, 49, 41, 52, 27, 33, 40, 51, 60, 70, 57, 67, 81, 93, 106, 123, 79, 68, 82, 71, 61, 74, 64, 36, 65, 78, 118, 77, 88, 100, 85, 97, 110, 124, 139, 155, 172, 193, 138, 154, 212, 232, 256, 191, 213
Offset: 1

Views

Author

Andrew Smith, Mar 30 2021

Keywords

Comments

Board is numbered as follows:
1 2 4 7 11 16 .
3 5 8 12 17 .
6 9 13 18 .
10 14 19 .
15 20 .
21 .
.
Both knights start on square 1, white moves to the lowest unvisited square (8), black then moves to the lowest unvisited square (9) and so on...
This sequence is finite, on the black knight's 5503rd step, square 3828 is visited, after which there are no unvisited squares within one knight move.

Crossrefs

Programs

A342948 Squares visited by either knight when a white knight and a black knight are moving on a diagonally numbered board, always to the lowest available unvisited square; white moves first.

Original entry on oeis.org

1, 8, 9, 6, 4, 2, 3, 12, 13, 16, 7, 24, 5, 19, 10, 15, 26, 34, 18, 14, 11, 21, 30, 43, 37, 20, 48, 25, 22, 17, 31, 39, 38, 29, 46, 23, 58, 32, 49, 42, 41, 35, 52, 45, 27, 53, 33, 28, 40, 54, 51, 63, 60, 73, 70, 84, 57, 50, 67, 59, 81, 47, 93, 56, 106, 69, 123
Offset: 1

Views

Author

Andrew Smith, Mar 30 2021

Keywords

Comments

Board is numbered as follows:
1 2 4 7 11 16 .
3 5 8 12 17 .
6 9 13 18 .
10 14 19 .
15 20 .
21 .
.
Both knights start on square 1, white moves to the lowest unvisited square (8), black then moves to the lowest unvisited square (9) and so on...
This sequence is finite, on the 583rd move or the white knight's 292nd step, square 406 is visited, after which black wins and the game is over.

Crossrefs

Programs

  • Python
    KM=[(2, 1), (1, 2), (-1, 2), (-2, 1), (-2, -1), (-1, -2), (1, -2), (2, -1)]
    def idx(loc): i, j = loc; return (i+j-1)*(i+j-2)//2 + j
    def next_move(loc, visited):
      i, j = loc; moves = [(i+io, j+jo) for io, jo in KM if i+io>0 and j+jo>0]
      available = [m for m in moves if m not in visited]
      return min(available, default=None, key=lambda x: idx(x))
    def aseq():
      loc, s, turn, alst = [(1, 1), (1, 1)], {(1, 1)}, 0, [1]
      m = next_move(loc[turn], s)
      while m != None:
        loc[turn], s, turn, alst = m, s|{m}, 1 - turn, alst + [idx(m)]
        m = next_move(loc[turn], s)
      return alst
    A342948_lst = aseq() # Michael S. Branicky, Mar 30 2021
Showing 1-5 of 5 results.