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.

Previous Showing 11-20 of 94 results. Next

A326918 Squares visited by a knight moving on a single-digit square-spiral numbered board where the knight moves to the smallest numbered unvisited square; the minimum distance from the origin is used if the square numbers are equal; the smallest spiral number ordering is used if the distances are equal.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 1, 1, 2, 2, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 2, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 2, 2, 1, 1, 0, 2, 3, 2, 2, 1, 3, 1, 1, 1, 2, 2, 3, 2, 3, 1, 4, 3, 5, 6, 1, 1, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 1, 0, 1
Offset: 0

Views

Author

Scott R. Shannon, Oct 21 2019

Keywords

Comments

This sequence uses the same board numbering as A326413, and like that sequence, if the next step encounters two or more squares with the same square number, it then chooses the square which is the closest to the original 0-squared origin. But if two or more squares are found which also have the same distance to the origin, then the square which was first drawn in the spiral numbering is chosen, i.e., the smallest standard spiral numbered square as in A316667.
The sequence is finite. After 1069 steps a square with the number 9 (standard spiral number = 473) is visited, after which all neighboring squares have been visited.
Sequence A326916(n) gives the number of the square visited at step n, i.e., its rank in the spiral, starting with 0, as illustrated, e.g., in A326413. The digit on that square, i.e., a(n) can be obtained through A007376, cf. formula. - M. F. Hasler, Oct 21 2019

Examples

			The squares are numbered using single digits of the spiral number ordering as:
                                .
    2---2---2---1---2---0---2   :
    |                       |   :
    3   1---2---1---1---1   9   3
    |   |               |   |   |
    2   3   4---3---2   0   1   1
    |   |   |       |   |   |   |
    4   1   5   0---1   1   8   3
    |   |   |           |   |   |
    2   4   6---7---8---9   1   0
    |   |                   |   |
    5   1---5---1---6---1---7   3
    |                           |
    2---6---2---7---2---8---2---9
If the knight has a choice of two or more squares in this spiral with the same number which also have the same distance from the origin, then the square with the minimum standard spiral number, as shown in A316667, is chosen.
		

Crossrefs

Cf. A174344, A274923, A296030 (coordinates of the square number n).

Formula

a(n) = A007376(A326916(n)). - M. F. Hasler, Oct 21 2019

A328908 Knight's tour on spirally numbered infinite chessboard, when the knight always jumps on the unvisited square closest to the origin, first according to 1-norm, then 2-norm, then number of the square: a(n) = number of the square visited at the n-th move.

Original entry on oeis.org

0, 9, 2, 5, 8, 3, 6, 1, 4, 7, 10, 13, 28, 31, 14, 11, 26, 23, 44, 19, 22, 43, 40, 17, 34, 37, 18, 15, 32, 29, 52, 25, 46, 21, 76, 47, 50, 27, 12, 33, 16, 39, 20, 45, 24, 51, 48, 77, 114, 73, 70, 105, 38, 35, 60, 93, 30, 53, 84, 49, 78, 115, 74, 41, 68, 103, 36, 61, 94, 57, 54, 85, 124, 175
Offset: 0

Views

Author

M. F. Hasler, Oct 31 2019

Keywords

Comments

Differs from A326924 (where only the 2-norm is considered) from a(73) = 175 on.
The sequence is also finite, when the knight lands on square number a(1092366) there is no unvisited square within reach.
The 1-norm or taxicab distance from the origin of the square a(n) is given in A328928(n).
It appears that this knight's tour would also completely fills the board, if we consider the infinite extension where the knight is allowed to move back on its last step(s) when there's no unvisited square available: no isolated sets of unvisited squares as defined in A323809, seem to occur. Is there a proof or disproof for this? - M. F. Hasler, Nov 04 2019

Examples

			The squares are numbered as in the spiral given in A174344 (upside down to get a counterclockwise spiral, but this is irrelevant here).
The knight starts at a(0) = 0 with coordinates (0, 0).
It jumps to a(1) = 9 with co-ordinates (2, -1): all 8 available squares (+-2, +-1) and (+-1, +-2) are at the same taxicab (2 + 1 = 3) and Euclidean distance (sqrt(2^2 + 1^2) = sqrt(5)) from the origin, but square number 9 has the smallest number.
a(73) = 175 with coordinates (7, 0) is the first destination which is preferred due to the 1-norm (= 7) over A326924(73) = 81 with coordinates (5, -4), having 1-norm 5 + 4 = 9 but Euclidean or 2-norm sqrt(41) smaller than 7.
a(1000) = 816 with coordinates (-10, -14).
a(2000) = 2568 with coordinates (-7, -25).
a(5000) = 4476 with coordinates (21, -33).
a(10000) = 15560 with coordinates (-2, -62).
a(20000) = 19566 with coordinates (-36, 70).
a(50000) = 62092 with coordinates (125, -33).
a(10^5) = 135634 with coordinates (-184, -26), taxicab distance 210 from the origin.
a(200'000) = 259798 with coordinates (47, 255).
a(500'000) = 713534 with coordinates (-68, -422).
a(1'000'000) = 995288 with coordinates (217, 499).
a(1'092'366) = 1165672 with coordinates (188, 540), taxicab norm 728 from the origin, is the last square visited by the knight before there is no unvisited square within reach.
By then the earliest square on the spiral not yet visited is number 629641 at (397, 396), taxicab norm 793, and the unvisited square closest to the origin is number 1794929 at (1, 670), taxicab norm 671.
		

Crossrefs

Cf. A328928 for the "value" (= 1-norm) on the visited square.
Cf. A316328 ~ A316667, A326924, A328909 (variants).
Cf. A174344, A274923, A296030 (coordinates of square number n).

Programs

  • PARI
    {Nmax=1e5;/* Full seq. with > 10^6 terms takes long to compute. */ local( K=[[(-1)^(i\2)<<(i>4),(-1)^i<<(i<5)]|i<-[1..8]], pos(x,y)=if(y>=abs(x),4*y^2-y-x,-x>=abs(y),4*x^2-x-y,-y>=abs(x),(4*y-3)*y+x,(4*x-3)*x+y), coords(n, m=sqrtint(n), k=m\/2)=if(m<=n-=4*k^2, [n-3*k, -k], n>=0, [-k, k-n], n>=-m, [-k-n, k], [k, 3*k+n]), t(x, p=pos(x[1],x[2]))=if(pt(x+K), K))[1][3], U=0,Umin=0); my(A=List(0)); for(n=1, Nmax, U+=1<<(A[n]-Umin); while(bittest(U,0), U>>=1;Umin++); iferr(listput(A, nxt(A[n])), E, break)); print("Index of the last term: ", #A-1); A328908(n)=A[n+1];}

Formula

A328928(n) = |A174344(a(n))| + |A274923(a(n))|, the 1-norm (or taxicab distance) of the square visited at the n-th step.

A326413 Successive squares visited by a knight on the single-digit square spiral, with ties resolved towards the left.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 1, 1, 2, 2, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 2, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 2, 2, 1, 1, 0, 2, 3, 2, 2, 1, 3, 1, 1, 1, 1, 1, 2, 2, 3, 2, 3, 1, 4, 3, 5, 6, 1, 1, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0
Offset: 1

Views

Author

N. J. A. Sloane, Oct 17 2019

Keywords

Comments

Take the standard counterclockwise square spiral starting at 0, as in A304586, but only write one digit at a time in the cells of the spiral: 0,1,2,3,4,5,6,7,8,9,1,0,1,1,1,2,...
Place a chess knight at cell 0. Move it to the lowest-numbered cell it can attack, and if there is a tie, move it to the cell closest (in Euclidean distance) to the start, and if there is still a tie, move to the left(*).
No cell can be visited more than once.
Inspired by the Trapped Knight video and A316667.
Just as for A316667, the sequence is finite. After a while, the knight has no unvisited squares it can reach, and the sequence ends with a(1217) = 4.
(*)Moving to the left means choose the point with the lowest x-coordinate. This leads to an unambiguous choice of tied squares only for the 'move left' case.

Examples

			The digit-square spiral is
                                .
                                .
    2---2---2---1---2---0---2   2
    |                       |   |
    3   1---2---1---1---1   9   3
    |   |               |   |   |
    2   3   4---3---2   0   1   1
    |   |   |       |   |   |   |
    4   1   5   0---1   1   8   3
    |   |   |           |   |   |
    2   4   6---7---8---9   1   0
    |   |                   |   |
    5   1---5---1---6---1---7   3
    |                           |
    2---6---2---7---2---8---2---9
		

Crossrefs

Extensions

More terms from Luca Petrone
Corrected and extended by Eric Angelini, Oct 24 2019

A316884 Squares visited by moving diagonally one square on a spirally numbered board and moving to the lowest available unvisited square at each step.

Original entry on oeis.org

1, 3, 11, 9, 23, 7, 19, 5, 15, 33, 13, 29, 53, 27, 25, 47, 77, 45, 21, 41, 69, 39, 17, 35, 61, 95, 59, 31, 55, 87, 127, 85, 51, 49, 79, 117, 163, 115, 75, 43, 71, 107, 151, 105, 67, 37, 63, 97, 139, 189, 137, 93, 57, 89, 129, 177, 233, 175, 125, 83, 81, 119
Offset: 1

Views

Author

Daniël Karssen, Jul 15 2018

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

Crossrefs

A323469 On a spirally numbered square grid, with labels starting at 1, this is the number of steps that a (1,n) leaper makes before getting trapped, or -1 if it never gets trapped.

Original entry on oeis.org

-1, 2016, 3723, 13103, 14570, 26967, 101250, 158735, 132688, 220439, 144841, 646728, 350720, 66183, 75259, 248764, 118694, 307483, 238208, 189159, 139639, 183821, 151016, 171076, 114187, 262235, 178612, 257632, 124475, 178862, 143674, 196795, 60707, 309820
Offset: 1

Views

Author

N. J. A. Sloane, Jan 28 2019

Keywords

Comments

A (1,2) leaper is a chess knight.
a(2)-a(5) were computed by Daniël Karssen.

Crossrefs

The sequences involved in this set of related sequences are A316884, A316967, A316667, A316328, A317106, A317105, A317416, A317415, A317438, A317437, and A323469, A323470, A323471, A323472.

Extensions

More terms from Rémy Sigrist, Jan 29 2019

A323471 On a spirally numbered square grid, with labels starting at 1, this is the number of the last cell that a (1,n) leaper reaches before getting trapped, or -1 if it never gets trapped.

Original entry on oeis.org

-1, 2084, 7081, 10847, 25963, 22421, 202891, 142679, 252953, 188501, 257479, 604328, 667827, 57217, 115497, 231930, 203331, 283651, 426851, 153521, 231299, 142267, 236487, 149872, 204527, 215033, 285983, 188082, 153461, 128802, 213853, 202259, 94967, 224778
Offset: 1

Views

Author

N. J. A. Sloane, Jan 28 2019

Keywords

Comments

A (1,2) leaper is a chess knight.
a(2)-a(5) were computed by Daniël Karssen.

Crossrefs

The sequences involved in this set of related sequences are A316884, A316967, A316667, A316328, A317106, A317105, A317416, A317415, A317438, A317437, and A323469, A323470, A323471, A323472.

Extensions

More terms from Rémy Sigrist, Jan 29 2019

A323808 Squares visited by a knight on a spirally numbered board and moving to the lowest available unvisited square at each step and if no unvisited squares are available move one step back.

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
Offset: 1

Views

Author

Daniël Karssen, Jan 28 2019

Keywords

Comments

This is an infinite extension of A316667 with which it agrees for the first 2016 terms. - N. J. A. Sloane, Jan 28 2019

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
See A323809 for examples where "backtracking" happens. - _M. F. Hasler_, Nov 06 2019
		

Crossrefs

The sequences involved in this set of related sequences are A316588, A316328, A316334, A316667, A323808, A323809, A323810, and A323811.
Cf. A326924 & A326922 (using L2-norm), A328908 & A328928 (L1-norm), A328909 & A328929 (sup norm); A326916 & A326918 (digits on spiral), A326413 and A328698 (variants with other tie breaker).

Programs

Formula

a(n) = A323809(n-1) + 1. - M. F. Hasler, Nov 06 2019

A323809 Squares visited by a knight on a spirally numbered board, moving always to the lowest available unvisited square, or one step back if no unvisited square is available.

Original entry on oeis.org

0, 9, 2, 5, 8, 3, 6, 1, 4, 7, 10, 13, 28, 31, 14, 11, 26, 23, 44, 19, 22, 43, 40, 17, 34, 37, 18, 15, 32, 29, 52, 25, 46, 21, 42, 69, 20, 39, 16, 33, 12, 27, 24, 45, 74, 41, 68, 103, 36, 61, 94, 57, 54, 85, 50, 47, 76, 113, 72, 107, 150, 67, 102, 63, 66, 35, 38, 65, 62
Offset: 0

Views

Author

Daniël Karssen, Jan 28 2019

Keywords

Comments

This is an infinite extension of A316328, with which it coincides for the first 2016 terms. - N. J. A. Sloane, Jan 29 2019
From M. F. Hasler, Nov 04 2019: (Start)
At move 99999, the least yet unvisited square has number 66048, which is near the border of the visited region. This suggests that the knight will eventually visit every square. Can this be proved or disproved through a counterexample?
More formally, let us call "isolated" a set of unvisited squares which is connected through knight moves, but which cannot be extended to a larger such set by adding a further square. Can there exist at some moment a finite isolated set which the knight cannot reach? (Without the last condition, the square a(2016) would clearly satisfy the condition just before the knight reaches it.)
Such subsets have a good chance of preserving this property forever. It should be possible to prove that an isolated subset sufficiently far (2 knight moves?) from any other unvisited square (or from the infinite connected subset of unvisited squares) remains so forever. (This condition of distance could replace the time-dependent condition "reachable by the knight".)
If such (forever) isolated sets do exist, with what frequency will they occur? Could they have a nonzero asymptotic density? Will this (if so, how) depend on the way the knight measures "lowest available" (cf. variants where the taxicab or Euclidean or sup norm distance from the origin is used)? (End)

Examples

			The board is numbered following a square spiral:
  16--15--14--13--12   :
   |               |   :
  17   4---3---2  11  28
   |   |       |   |   |
  18   5   0---1  10  27
   |   |           |   |
  19   6---7---8---9  26
   |                   |
  20--21--22--23--24--25
.
From _M. F. Hasler_, Nov 06 2019: (Start)
At move 2015, the knight lands on a(2015) = 2083, from where no unvisited squares can be reached. So the knight moves back to a(2016) = a(2014) = 2466, from where it goes on to the unvisited square a(2017) = 2667.
Similarly, at moves 2985, 3120, 3378, 7493, 8785, 9738, 10985, 11861, 11936, 12160, 18499, 18730, 19947 and 22251, the knight get "trapped" and has to move to the previous square on the next move.
On move 23044, the same happens on square 25808, and the knight must move back to square a(23045) = a(23043) = 27111. However, there is still no unvisited square in reach, so the knight has to make another step back to a(23046) = a(23042) = 28446, before it can move on to a(23047) = 29123. (End)
		

Crossrefs

The sequences involved in this set of related sequences are A316588, A316328, A316334, A316667, A323808, A323809, A323810 and A323811.
Cf. A326924 & A326922 (using L2-norm), A328908 & A328928 (L1-norm), A328909 & A328929 (sup norm); A326916 & A326918 (digits on spiral), A326413 and A328698 (variants with other tie breaker).

Programs

  • PARI
    Nmax=1e5 /* number of terms to compute */; {local( K=[[(-1)^(i\2)<<(i>4),(-1)^i<<(i<5)]|i<-[1..8]], pos(x,y)=if(y>=abs(x),4*y^2-y-x,-x>=abs(y),4*x^2-x-y,-y>=abs(x),(4*y-3)*y+x,(4*x-3)*x+y), coords(n, m=sqrtint(n), k=m\/2)=if(m<=n-=4*k^2, [n-3*k, -k], n>=0, [-k, k-n], n>=-m, [-k-n, k], [k, 3*k+n]), U=0, Umin=0, t(x, p=pos(x[1],x[2]))=if(pt(x+K), K))[1], back=0); my(A=List(0)); for(n=1, Nmax, back||U+=1<<(A[n]-Umin); while(bittest(U,0), U>>=1; Umin++); listput(A, nxt(A[n])); if(A[n+1] != oo, back=0, A[n+1]=A[n+1-back+=2])); print("Index of the last term: ", #A-1); A323809(n)=A[n+1];}

Formula

a(n) = A323808(n+1) - 1. - M. F. Hasler, Nov 06 2019

Extensions

Edited by M. F. Hasler, Nov 02 2019

A326916 Trajectory of the knight's tour for choice of the square with the lowest digit, then closest to the origin, then first in the spiral.

Original entry on oeis.org

0, 11, 14, 31, 28, 51, 10, 13, 34, 95, 190, 247, 312, 385, 244, 133, 242, 239, 376, 301, 372, 233, 370, 295, 232, 173, 228, 367, 230, 171, 226, 223, 358, 285, 220, 355, 282, 217, 352, 283, 218, 115, 44, 73, 20, 71, 40, 17, 36, 15, 18, 3, 12, 1, 22, 75, 46, 117, 48, 77, 24, 79, 50, 81, 118, 221, 286, 225, 292, 229, 296, 451, 298, 235
Offset: 0

Views

Author

M. F. Hasler, Oct 21 2019

Keywords

Comments

A variant of Angelini's "Kneil's Knumberphile Knight", inspired by Sloane's "The Trapped Knight", cf. A316328 and links:
Consider an infinite chess board with squares numbered along the infinite square spiral starting with 0 at the origin (as in A174344, A274923 and A296030). The squares are filled with successive digits of the integers: 0, 1, 2, ..., 9, 1, 0, 1, 1, ... (= A007376 starting with 0). The knight moves at each step to the yet unvisited square with the lowest digit on it, and in case of a tie, the one closest to the origin, first by Euclidean distance, then by appearance on the spiral (i.e., number of the square). This sequence lists the number of the square visited in the n-th move, if the knight starts at the origin, viz a(0) = 0.
It turns out that following these rules, the knight gets trapped at the 1070th move, when he can't reach any unvisited square.
See A326918 for the sequence of visited digits, given as A007376(a(n)).
Many squares, e.g., 2: (1,1), 4: (-1,1), 5: (-1,0), 6: (-1,-1), 7: (0,-1), 8: (1,-1), 9: (2,-1), ..., will never be visited, even in the infinite extension of the sequence where the knight can move back if it gets trapped, in order to resume with a new unvisited square, as in A323809. - M. F. Hasler, Nov 08 2019

Crossrefs

Programs

  • PARI
    {L326916=List(0) /* list of terms */; U326916=1 /* bitmap of used squares */; local( K=vector(8, i, [(-1)^(i\2)<<(i>4), (-1)^i<<(i<5)])/* knight moves */, coords(n, m=sqrtint(n), k=m\/2)=if(m<=n-=4*k^2, [n-3*k, -k], n>=0, [-k, k-n], n>=-m, [-k-n, k], [k, 3*k+n]), pos(x, y)=if(y>=abs(x), 4*y^2-y-x, -x>=abs(y), 4*x^2-x-y, -y>=abs(x), (4*y-3)*y+x, (4*x-3)*x+y), val(x, p=pos(x[1],x[2]))=if(bittest(U326916, p), oo, [A007376(p), norml2(x), p])); iferr( for(n=1,oo, my(x=coords(L326916[n])); U326916+=1<A326916(n)=L326916[n+1]} \\ Requires function A007376; defines function A326916.

A329519 Squares visited by a knight moving on a square-spiral numbered board where the knight moves to an unvisited square with the lowest spiral number and with six or fewer visited neighbors. It only moves to squares with seven or more visited neighbors when no other square is available; if two or more such squares are present it chooses the square with the fewest neighbors, then the square with the lowest spiral number if still tied.

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
Offset: 1

Views

Author

Scott R. Shannon, Nov 18 2019

Keywords

Comments

This is a variation of A316667. The same knight move rules apply, but the knight will not move to a square which has seven or eight visited neighbors unless no other square is available. If the only unvisited squares available to move to have seven or eight neighbors it will choose the one with the lowest number of neighbors first, and if a tie still exists it will choose the one with the smallest spiral number.
The sequence is finite. After 3935788 steps the square with spiral number 3352743 is reached after which all surrounding squares have been visited. This is the longest possible path using the given knight-leap rules for the eight possible values of visited neighbor count. A329520 gives the other path lengths.
The sequences matches the values of A316667 for the first 332 terms, but on the 332nd step the knight sees that square 193 has seven visited neighbors and thus chooses square 393 instead. Along its path the knight encounters 38812 squares where it would have chosen a square with seven or eight neighbors if only the lowest spiral number was considered; 21897 squares had seven neighbors, 16915 squares had eight neighbors. Of those squares thirteen times a square with seven neighbors was actually chosen due to no other square with a lower neighbor count being available. The first such encounter is after 380990 steps while on the square with number 295910. On this first encounter a square with eight neighbors is also available, and has a lower board number than the square with seven neighbors. Thus if the rules were changed to always select the lowest board number regardless of the number of neighbors in such cases then the knight would choose the eight-neighbor square and thus be trapped after 380990 steps.
Due to the knight's avoidance of trapping or potentially trapping squares numerous squares which are inside the knight's overall path are never visited; the first such example is square 193 mentioned above. This is in contrast to standard knight's tours which typically cover all internal squares.

Examples

			See A316667 for the spiral board numbering.
		

Crossrefs

Previous Showing 11-20 of 94 results. Next