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 21-30 of 94 results. Next

A323714 Squares where knight moving to a lowest unvisited square on a spirally numbered board will have no available moves.

Original entry on oeis.org

2084, 2720, 3325, 3753, 7776, 5632, 7411, 8562, 14076, 8469, 9231, 22702, 14661, 21710, 21078, 25809, 27112, 24708, 19844, 26943, 26737, 32449, 31366, 45036, 37853, 37188, 43318, 62095, 67401, 68736
Offset: 1

Views

Author

Sami Mäki, Jan 25 2019

Keywords

Comments

First term is the last term of A316667. Next terms are given by repeatedly blocking the squares where the knight would not have any available moves.
Plotting the terms on XY-plane seems to show a clear pattern where most of the points only land on certain directions from the center.
Inspired by A316667 and comments on N. J. A. Sloane and Brady Haran, The Trapped Knight, Numberphile video (2019).

Crossrefs

A328698 Successive squares visited by a knight on the single-digit square spiral, with ties resolved by rotating left from direction of the last leap.

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, 2, 1, 1, 1, 3, 2, 1, 1, 0, 2, 3, 2, 2, 1, 3, 1, 1, 1, 1, 1, 6, 2, 3, 4, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 5, 0, 1, 1, 1, 0, 0, 1, 0, 1, 2, 2, 0, 2, 0, 1, 2, 3, 0, 1, 1, 1
Offset: 0

Views

Author

Scott R. Shannon, Oct 25 2019

Keywords

Comments

This is a variation of sequence A326413 where, instead of taking the lowest x-coordinate of the two tied squares with the same board number and distance from the origin, rotate left (counterclockwise) from the direction of the last leap and choose the first of the two squares encountered.
For the sequence given here, if a tied square is directly in line with the last leap direction it is chosen last. The sequence is finite as after 644 steps a square with the number 7 is reached after which all eight surrounded squares have been visited.
For the sequence where a tied square which is directly in line with the last leap direction is chosen first, then there are 946 steps taken before the knight is trapped. The visited squares for this variation are given as a link.

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

A335816 Squares visited by a chess king moving on a square-spiral numbered board where the king moves to the adjacent unvisited square containing the spiral number with the fewest divisors. In case of a tie it chooses the square with the lowest spiral number.

Original entry on oeis.org

1, 2, 3, 11, 29, 13, 31, 59, 33, 61, 97, 139, 191, 251, 193, 141, 142, 143, 101, 65, 37, 17, 5, 19, 7, 23, 47, 79, 49, 25, 9, 8, 6, 4, 14, 15, 34, 35, 62, 63, 98, 99, 64, 66, 67, 103, 149, 201, 263, 331, 409, 493, 587, 586, 687, 797, 689, 589, 691, 591, 499, 593, 501
Offset: 1

Views

Author

Scott R. Shannon, Jun 25 2020

Keywords

Comments

This sequences gives the numbers of the squares visited by a chess king moving on a square-spiral numbered board where the king starts on the 1 numbered square and at each step moves to an adjacent unvisited square, out of the eight adjacent neighboring squares, which contains the number with the fewest divisors. If two or more adjacent squares exist with the same fewest number of divisors then the square with the lowest spiral number is chosen. Note that if the king simply moves to the smallest available number, as the knight does in A316667, the sequence will be infinite as the king will just follow the square spiral path.
The sequence is finite. After 411 steps the square with number 760 is visited, after which all adjacent neighboring squares have been visited.
Due to the king's preference for squares with the fewest divisors it will move to a prime numbered square when possible, and the lowest prime if two or more unvisited primes are in adjacent squares. Of the 411 visited squares 134 contain prime numbers while 277 contain composites. The largest visited square is a(365) = 3061.

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 king.
a(2) = 2. The eight unvisited squares around a(1) the king can move to are numbered 2,3,4,5,6,7,8,9. Of these 2,3,5,7 have the minimum two divisors, and of those 2 is the smallest.
a(4) = 11. The six unvisited squares around a(3) = 3 the king can move to are numbered 4,11,12,13,14,15. Of these 11 and 13 have the minimum two divisors, and of those 11 is the smallest.
		

Crossrefs

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

Original entry on oeis.org

-1, 2015, 3722, 13102, 14569, 26966, 101249, 158734, 132687, 220438, 144840, 646727, 350719, 66182, 75258, 248763, 118693, 307482, 238207, 189158, 139638, 183820, 151015, 171075, 114186, 262234, 178611, 257631, 124474, 178861, 143673, 196794, 60706, 309819
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

A323472 On a spirally numbered square grid, with labels starting at 0, 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, 2083, 7080, 10846, 25962, 22420, 202890, 142678, 252952, 188500, 257478, 604327, 667826, 57216, 115496, 231929, 203330, 283650, 426850, 153520, 231298, 142266, 236486, 149871, 204526, 215032, 285982, 188081, 153460, 128801, 213852, 202258, 94966, 224777
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

A330008 Squares visited by a knight moving on a square-spiral numbered board where the knight moves to an unvisited square with the lowest prime spiral number, or lowest composite number if no primes are available.

Original entry on oeis.org

1, 10, 3, 6, 17, 4, 7, 2, 5, 8, 11, 14, 29, 32, 61, 16, 19, 22, 41, 18, 37, 62, 139, 60, 13, 28, 9, 12, 31, 54, 89, 30, 53, 26, 47, 76, 23, 20, 43, 70, 109, 42, 73, 44, 71, 40, 67, 36, 97, 34, 59, 56, 131, 88, 127, 52, 83, 80, 167, 82, 173, 84, 27, 24, 79, 46, 21, 72, 107
Offset: 1

Views

Author

Simon S. Gurvets, Nov 26 2019

Keywords

Comments

The squares are numbered starting with 1 at the origin (0,0). The sequence is finite: when arriving on square number a(209) = 147, there is no free square within reach for the next move. - M. F. Hasler, Jan 26 2020

Crossrefs

Cf. A316667.

Programs

  • PARI
    local(U); my(v(p)=if(bittest(U,p),[9,0],[1-isprime(p+1),p]), nxt(x)=vecsort([v(pos(x+k))|k<-K])[1][2], K=[[(-1)^(i\2)<<(i>4),(-1)^i<<(i<5)]|i<-[1..8]], pos(x,y=x[2])=if(y>=abs(x=x[1]),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), xy(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]), A=List(0)); until(!listput(A,nxt(xy(A[#A]))), U+=1<A330008=[t+1|t<-A[^-1]] \\ M. F. Hasler, Jan 26 2020

A333714 Squares visited by a chess king moving on a square-spiral numbered board where the king moves to the adjacent unvisited square containing the spiral number with the most divisors. In case of a tie it chooses the square with the highest spiral number.

Original entry on oeis.org

1, 8, 24, 48, 80, 120, 168, 224, 288, 360, 440, 528, 624, 728, 840, 960, 1088, 1224, 1368, 1520, 1680, 1848, 2024, 2208, 2400, 2600, 2808, 3024, 3248, 3480, 3720, 3968, 4224, 4488, 4760, 5040, 5328, 5624, 5928, 6240, 6560, 6888, 7224, 7568, 7920, 8280, 8648, 9024, 9408, 9800, 10200, 10608
Offset: 1

Views

Author

Scott R. Shannon, Jul 02 2020

Keywords

Comments

This sequence gives the numbers of the squares visited by a chess king moving on a square-spiral numbered board where the king starts on the 1 numbered square and at each step moves to an adjacent unvisited square, out of the eight adjacent neighboring squares, which contains the number with the most divisors. If two or more adjacent squares exist with the same highest number of divisors then the square with the highest spiral number is chosen. Given both of these rules tend to force the king to squares with larger numbers, and thus move away from the central 1 starting square, it is remarkable that the king is eventually trapped. Note that if the king simply moves to the highest available number the sequence will be infinite as the king will step along the southeast diagonal from square 1 forever.
The sequence is finite. After 1113 steps the square with number 855481 is visited, after which all adjacent neighboring squares have been visited.
Due to the king's preference for squares with the most divisors it will avoid prime numbers unless no other choice exists. Of the 1113 visited squares only once does it visit a square with a prime number, at a(308) = 108223. This is due to a(307) = 106913 having square 108223 as its sole neighboring unvisited square. This is the only time in the sequence where only one unvisited adjacent neighbor is available.
As even numbers >= 6 will always contain 4 or more divisors the king will tend to visit more even numbers than odd numbers; in the 1113 visited squares 929 contain an even number while only 184 contain an odd number.
As the even numbers are diagonally adjacent in the square spiral the king's path will be dominated by diagonal steps, often taking many diagonal steps in succession - see the attached link image. In fact after the first downward step to 8 the next 110 steps are along the southeast diagonal, stepping to successively larger even numbers. This sequence is finally broken on the 112th step when the square with number 50624, with 28 divisors, is the next square in the southeast direction. However the square with number 50622, with 32 divisors, is in the southwest direction so is the next square chosen. It is not until the 166th step, to the square with number 108230, that the path takes a step to a lower number than the one it is currently on.
The largest visited square is a(1050) = 942676. The visited square with the maximum number of divisors is a(680) = 388080, which has 180 divisors. The lowest unvisited square is 2.

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 king.
a(2) = 8. The eight unvisited squares around a(1) the king can move to are numbered 2,3,4,5,6,7,8,9. Of these 6 and 8 both have the maximum four divisors, and of those 8 is the largest.
a(3) = 24. The seven unvisited squares around a(2) = 8 the king can move to are numbered 9,2,6,7,22,23,24. Of these 24 has eight divisors, the largest number.
a(113) = 50622. The seven unvisited squares around a(112) = 49728 the king can move to are numbered 50622, 49727, 50623, 48841, 50624, 49729, 48842. Of these 50622 has thirty-two divisors, the largest number. This is the step that breaks the sequence of 110 steps to the southeast direction starting from a(2) = 8.
a(308) = 108223. This is the first and only time a prime number is visited; a(307) = 106913 has square 108223 as the sole unvisited adjacent neighbor.
a(1114) = 855481. The two unvisited squares around a(1113) = 859184 the king can move to are numbered 862894 and 855481. Of these 855481 has eight divisors, the largest number. However square 855481 is surrounded by the eight squares with numbers 859183, 855480, 851785, 859184, 851786, 859185, 855482, 851787 all of which have been previously visited, so the king is trapped.
		

Crossrefs

Cf. A333713 (choose lowest spiral number in case of tie), A335816, A316667, A330008, A329520, A326922, A328928, A328929, A033996.

A343678 The square of the distance from the origin for the points visited by a knight moving on a 3D cubic lattice using the rules given in the Comments.

Original entry on oeis.org

0, 5, 2, 1, 2, 1, 2, 1, 2, 9, 2, 1, 6, 9, 8, 1, 2, 9, 14, 13, 12, 13, 14, 17, 14, 17, 14, 17, 18, 17, 14, 17, 10, 13, 12, 13, 12, 21, 14, 13, 12, 13, 14, 9, 10, 9, 14, 17, 18, 19, 14, 17, 14, 21, 26, 17, 14, 19, 14, 11, 14, 17, 14, 17, 14, 17, 26, 17, 14, 11, 14, 17, 18, 17, 14, 11, 18, 29, 22, 25
Offset: 1

Views

Author

Scott R. Shannon, Apr 25 2021

Keywords

Comments

Consider a knight, starting at the origin of a 3D cubic lattice, which can only move to the 24 neighboring points one knight-leap away which have not been previously visited and where the choice of point for its next step is given by the following rules. 1. Move to the neighboring point which itself has the fewest visited neighboring points one knight-leap away from it. 2. If two or more points have the same visited neighbor count move to one of those points which is the closest to the origin. 3. If two or more points are the same distance from the origin move to one of those points which has the maximum value for the product of the absolute values of its x, y and z coordinates. 4. If two or more points have the same maximum coordinate product move to one of those points which has the maximum value for the sum of the absolute values of its x, y and z coordinates. 5. If two or more points have the same maximum coordinate sum move to the point with the smallest x-coordinate absolute value, then if equal the smallest y-coordinate absolute value, then if equal the smallest z-coordinate absolute value. 6. If still equal move to the point with the largest x-coordinate, then if equal the largest y-coordinate, then if equal the largest z-coordinate.
The sequence gives the square of the distance from the origin for the points visited by a knight following these rules.
The sequence is finite. After 811351 steps the point with coordinates (-3,2,0) is reached after which all 24 neighboring points one knight-leap away have been visited.
Rules 1 and 2 are the most important and must be taken in the given order for the knight to be trapped within 2 million steps. As in A330189 it would appear that first choosing a neighbor with the fewest visited neighbors would force the knight to move away from the origin and be less likely to be trapped. But the opposite is true as, although the knight does move away from the origin at first, its path leaves regions of unvisited points which are large enough that the knight will eventually go back into these regions and be forced toward the origin where it cannot escape. If instead for each step we first choose a point as close as possible to the origin the knight will densely cover all points close to the origin and leave very few or no unvisited regions which can later be visited. This results in a spherical region of visited points that grows further and further out from the origin which cannot readily be penetrated and so the knight is forced to continuously move outward. Switching rules 1 and 2 leads to a path of at least 250 million steps without being trapped, and it is unknown if the knight is ever trapped in this case.
Rules 3 to 6 are more arbitrary due to there being no simple equivalent in 3D for the 2D square-spiral numbering. Many orderings of these rules are possible, and one can also change the largest or smallest test condition to its opposite for the tests within these rules. Each will create a knight path with a different number of steps before being trapped. For example switching rules 3 and 4 results in the path being trapped after 1101154 steps. The rules given result in the shortest path before being trapped so far found for various combinations tested, although shorter paths probably exist. But all combinations so far tested with rule 1 and 2 as given all result in the knight eventually being trapped, indicating these are the required conditions for such paths.
See A343746 for the x,y,z coordinates of the visited points and examples of the points chosen.
See A343747 for the x coordinates of the visited points.
See A343748 for the y coordinates of the visited points.
See A343749 for the z coordinates of the visited points.

Crossrefs

Cf. A343746 (point x,y,z coordinates), A343747 (point x coordinates), A343748 (point y coordinates), A343749 (point z coordinates), A330189, A329520, A316667.

A306291 List of possible numbers for the final 'trapped' square of a knight moving on an infinitely large 2-dimensional spirally numbered board starting from any square.

Original entry on oeis.org

104, 125, 149, 150, 215, 235, 247, 260, 261, 262, 266, 277, 295, 311, 329, 330, 365, 368, 369, 385, 389, 404, 406, 408, 424, 425, 432, 445, 448, 467, 469, 489, 490, 494, 495, 512, 518, 534, 535, 536, 556, 557, 558, 561, 569, 580, 581, 582, 583, 586, 588, 604, 605, 606, 629, 631, 632, 634, 655, 659
Offset: 1

Views

Author

Scott R. Shannon, Feb 04 2019

Keywords

Comments

This is a complete list of all the possible ending 'trapped' square values for the knight (2 by 1 leaper) starting from any square. The list has 1518 values - the knight starting from any square on the infinite board will eventually be trapped on a square with one of these numbers.
I do not have a proof this is the complete list of all ending values but I believe it is correct. I have checked every knight starting square up to 100000 and they all end on one of these 1518 squares. I then check further out to 110000 and ensure these paths always move inwards once they pass the square of values which contains the 100000 value, and check they do not move outwards again passed this square. As every knight sequence out to infinity would have to cross/land between this 100000 to 110000 group of values (as they are attracted toward square 1 due to their lowest-available-value preference), and as all values have been checked inside these, it implies all knight paths with starting square values out to infinity eventually end on this list of 1518 squares.
Also note this is the ordered sequence of all 1518 squares - the initial value found starting the knight at square 1 is 2084.

Examples

			The ending square for the knight starting on square with value 1 is 2084 (see A316667). The first starting square value to end on square 104 (the smallest value) is 175. The first starting square value to end on square 23134 (the largest value) is 11509.  Testing various upper limits has shown the square with number 404 is the most likely square for any random starting square to end on (about 8% of all sequences end on it). The complete list of 1518 end squares can be generated by checking all starting squares from 1 up to 17390 (which produces the 1518th different end square of value 16851).
		

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.

A333713 Squares visited by a chess king moving on a square-spiral numbered board where the king moves to the adjacent unvisited square containing the spiral number with the most divisors. In case of a tie it chooses the square with the lowest spiral number.

Original entry on oeis.org

1, 6, 18, 40, 70, 108, 72, 42, 20, 21, 44, 45, 75, 114, 160, 216, 280, 350, 351, 352, 432, 520, 616, 720, 832, 952, 1080, 1216, 1360, 1512, 1672, 1840, 2016, 2200, 2392, 2592, 2800, 3016, 3240, 3472, 3710, 3956, 4212, 4476, 4746, 5024, 5310, 5022, 4743, 4472, 4473, 4209, 4208, 3952, 3705
Offset: 1

Views

Author

Scott R. Shannon, Jul 02 2020

Keywords

Comments

This sequences gives the numbers of the squares visited by a chess king moving on a square-spiral numbered board where the king starts on the 1 numbered square and at each step moves to an adjacent unvisited square, out of the eight adjacent neighboring squares, which contains the number with the most divisors. If two or more adjacent squares exist with the same highest number of divisors then the square with the lowest spiral number is chosen. Note that if the king simply moves to the highest available number the sequence will be infinite as the king will step along the south-east diagonal from square 1 forever.
The sequence is finite. After 1784 steps the square with number 1478 is visited, after which all adjacent neighboring squares have been visited.
Due to the king's preference for squares with the most divisors it will avoid prime numbers unless no other choice exists. Of the 1784 visited squares only 27 contain prime numbers while 1757 contain composites. As even numbers >= 6 will always contain 4 or more divisors the king will tend to visit more even numbers than odd numbers; in the 1784 visited squares 1289 contain an even number while 495 contain an odd number. As the even numbers are diagonally adjacent in the square spiral the king's path will be dominated by diagonal steps, often taking numerous diagonal steps is succession - see the attached link image.
The largest visited square is a(390) = 17664. The lowest unvisited square is 2.

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 king.
a(2) = 6. The eight unvisited squares around a(1) the king can move to are numbered 2,3,4,5,6,7,8,9. Of these 6 and 8 both have the maximum four divisors, and of those 6 is the smallest.
a(3) = 18. The seven unvisited squares around a(2) = 6 the king can move to are numbered 4,5,18,19,20,7,8. Of these 18 and 20 have the maximum six divisors, and of those 18 is the smallest.
a(603) = 821. This is the first prime number visited; a(602) = 939 has square 821 as the sole unvisited adjacent neighbor.
		

Crossrefs

Cf. A333714 (choose highest spiral number in case of tie), A335816, A316667, A330008, A329520, A326922, A328928, A328929.
Previous Showing 21-30 of 94 results. Next