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 22 results. Next

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.

A340974 The sum of the numbers on straight lines of incrementing length n when drawn over numbers of the square spiral, where each line contains numbers which sum to the minimum possible value, and each number on the spiral can only be in one line. If two or more lines exist with the same sum the one containing the smallest number is chosen.

Original entry on oeis.org

1, 5, 18, 46, 95, 171, 238, 372, 549, 775, 1056, 1398, 1807, 2289, 2850, 3482, 3940, 4539, 5525, 6384, 7225, 8263, 9159, 10864, 12032, 13881, 15453, 17094, 18862, 20339, 22758, 25122, 27567, 30605, 33060, 36836, 39285, 43277, 45310, 48850, 53337, 56889, 62264, 65812, 72139, 77531, 81325
Offset: 0

Views

Author

Scott R. Shannon, Feb 01 2021

Keywords

Comments

The upper and left segments of the spiral contain most of the lines, with the bottom segment containing significantly fewer. Up to 500 lines the only two in the right segment are a(1) = 5 and a(3) = 46. It is unknown if any more appear. The list of numbers that are definitely never covered starts 4,8,9,14,15,16. Whether the next lowest are 38,39,40,... or 27,28,29,... is currently unknown as that is dependent on the existence of further vertical or horizontal lines in the right segment.
Up to 500 lines the only occurrence of two lines with the same sum is a(5) = 171. See the examples below. In this instance if the line with the higher numbers is instead chosen then the value for a(6) becomes 273 but otherwise all other lines and sums are identical to the current sequence.

Examples

			The square spiral used is:
.
  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(0) = 1 as a line of length 0 covers the number 1, which is the minimum possible value.
a(1) = 5 as a line of length 1 is drawn over numbers 2 and 3, which sum to 5. This is the minimum possible sum for such a line which does not use the previously covered number 1.
a(2) = 18 as a line of length 2 is drawn over numbers 5,6,7, which sum to 18. This is the minimum possible sum for such a line which does not use the previously covered numbers 1,2,3.
a(5) = 171 as a line of length 5 is drawn over numbers 22,23,24,25,26,51, which sum to 171. A straight line of length 5 can also be drawn over the uncovered numbers 26,27,28,29,30,31 which also sums to 171, but as the former contains 22, the smallest number of these sets, that is the line chosen. This is the only instance in the first 500 lines where two lines exist with the same sum.
		

Crossrefs

A341160 The sum of the numbers inside the squares of incrementing size n x n when the square spiral is tiled with these squares, where each tile contains numbers which sum to the minimum possible value, and each number on the spiral can only be in one tile.

Original entry on oeis.org

1, 28, 180, 622, 1910, 3880, 8162, 17592, 28600, 45380, 79376, 122592, 174889, 223556, 313350, 393912, 604421, 792202, 1089859, 1410896, 1644223, 2120976, 2923991, 3369408, 4002500, 5136496, 6298670, 7476224, 8323935, 9464220, 10653646, 12985600, 17233062, 20321768, 22053045, 27665722
Offset: 1

Views

Author

Scott R. Shannon, Feb 06 2021

Keywords

Comments

See A341327 for the list of the spiral numbers not covered by any square in the tiling.

Examples

			The square spiral used is:
.
  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 as a square of size 1 x 1 is placed on the number 1, which is the minimum possible value.
a(2) = 28 as a square of size 2 x 2 is placed such that it covers the numbers 2,3,11,12 which sum to 28. This is the minimum possible sum for such a square which does not use the previously covered number 1.
a(3) = 180 as a square of size 3 x 3 is placed such that it covers numbers 4,5,18,15,16,17,34,35,36 which sum to 180. This is the minimum possible sum for such a square which does not use the previously covered numbers 1,2,3,11,12.
		

Crossrefs

Cf. A341327 (spiral numbers not covered), A340974 (lines), A174344, A274923, A296030, A275161.

A344325 Squares visited on a spirally numbered board when stepping to the closest unvisited square which contains a number that shares no digit with the number of the current square. If two or more such squares are the same distance away the one with the smaller number is chosen.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 25, 48, 79, 80, 49, 26, 51, 84, 125, 83, 50, 81, 52, 86, 53, 28, 11, 27, 85, 126, 87, 54, 29, 30, 55, 88, 129, 56, 31, 58, 93, 57, 90, 131, 89, 130, 92, 135, 94, 137, 95, 60, 33, 14, 32, 59, 13, 62, 35, 16, 34, 15, 36, 17, 38, 67, 104, 66, 37, 64, 99, 100, 65, 102
Offset: 1

Views

Author

Scott R. Shannon and Eric Angelini, May 15 2021

Keywords

Comments

The sequence is infinite as a number containing all ten decimal digits can never be stepped to thus there will always be a square containing a number which has digits not in the number of the current square.
The pattern of visited squares forms nine closely spaced concentric square rings, while these groups of nine have a larger gap of unvisited squares between them. See the linked images.
In the first one million steps the largest single step distance is ~480 units, from a(572017) = 627194 to a(572018) = 3055000. This is a step that jumps between the inner to most outer group of nine concentric rings. The largest single step difference between numbers is from a(721912) = 6951823 to a(721913) = 4404077, a change of 2547746. The smallest unvisited number in the first one million steps is 12, although the image shows the path revisits squares close to the origin after a large number of steps, so it is possible this and other small numbers will eventually be visited.

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(2) = 2 as from 1 there are four numbers one unit away, 2,4,6,8, none of which contain the digit 1, so of these the smallest is chosen, which is 2.
a(11) = 25 as from the square 10 the square with 25 is only one unit away and shares no digit with 10.
a(20) = 83 as the four squares one unit away from 125 have been visited or contain digits 1,2 or 5. The square with 83 is diagonally adjacent to 125 and is the first time a square more than one unit away is stepped to.
a(23) = 52, and is the first square stepped to that is not adjacent to the previous square, being three units away from 81. All closer squares have been either visited or contain a 1 or 8 in their number.
		

Crossrefs

A344367 Squares visited on a spirally numbered board when stepping to the closest unvisited square that contains a number that shares one or more digits with the number of the current square. If two or more such squares are the same distance away the one with the smaller number is chosen.

Original entry on oeis.org

1, 11, 10, 12, 13, 14, 15, 16, 17, 18, 19, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 3, 23, 22, 21, 20, 40, 41, 42, 43, 44, 45, 46, 47, 24, 25, 26, 27, 28, 29, 2, 52, 51, 50, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 59, 58, 57, 56, 55, 54, 53, 125, 124, 123, 122, 121, 120
Offset: 1

Views

Author

Scott R. Shannon and Eric Angelini, May 16 2021

Keywords

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(2) = 11. There are three squares 2 units away from the starting square 1 that also contain the digit 1 - 11, 15, and 19. Of these 11 is the smallest so is the square stepped to.
a(3) = 10. Of the two adjacent squares to 11 that also contain the digit 1 the square 10 is the smallest.
a(4) = 12. This is the only unvisited square within 2 units of a(3) = 10 that also contains the digit 1.
a(12) = 39. This is the only unvisited square within sqrt(2) units of a(11) = 19 that contains either the digit 3 or 9. It is also the first square stepped to that does not share the digit 1 with the previous square.
		

Crossrefs

A328894 a(n) is the number of steps before being trapped for a knight starting on square n on a single-digit square-spiral numbered board and 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

1069, 884, 995, 884, 885, 988, 885, 943, 549, 1070, 942, 548, 881, 951, 987, 886, 661, 601, 1123, 1313, 1034, 1070, 1101, 1070, 1930, 943, 655, 882, 1930, 943, 1471, 992, 583, 884, 806, 704, 1062, 1098, 1096, 1129, 1174, 723, 438, 1102, 854
Offset: 1

Views

Author

Scott R. Shannon, Oct 29 2019

Keywords

Comments

This is the number of completed steps before being trapped for a knight starting on a square with square spiral number n for a knight with step rules given in A326918. We use the standard square spiral number of A316667 to define the start square, as opposed to its single-digit board value, as it is a unique value for each square on the board.
Unlike board numbering methods which have a unique smallest value at the origin, which causes the knight to immediately move toward it when starting from any other square, the single-digit numbering method has multiple small values distributed over the board. Therefore when starting from an arbitrary square the knight may move in any direction, toward the smallest valued neighboring square one knight leap away. Only when two or more such squares exist with the same number does the origin start to act as the square of attraction. This means some knight paths will meander well away from the origin and can become trapped before ever approaching it.
For starting squares n from 1 to 10^6 the longest path before being trapped is a(435525) = 2865. The smallest path to being trapped is a(42329) = 109. The path which ends on the square with the largest standard square spiral number is a(31223), which ends on square 47863. The first path which ends on the square with the smallest standard spiral number is a(138), which ends on square 4. This square is adjacent to the origin, but it is curious that the three squares with smaller spiral numbers, 1,2,3, do not act as the end square for any of the starting squares studied.

Examples

			a(1) = 1069. See A326918.
The squares are numbered using single digits of the spiral number ordering as:
                                .
                                .
    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
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

A341327 The spiral numbers not covered by any square in the square spiral tiling of A341160.

Original entry on oeis.org

6, 19, 28, 29, 53, 54, 61, 62, 63, 86, 87, 114, 115, 116, 117, 161, 162, 163, 164, 185, 186, 187, 188, 189, 227, 228, 229, 230, 231, 232, 244, 245, 246, 247, 248, 311, 312, 313, 314, 315, 407, 408, 409, 410, 411, 412, 413, 771, 772, 773, 774, 775, 776, 777, 778, 779, 866, 867, 868, 869, 870, 871
Offset: 1

Views

Author

Scott R. Shannon, Feb 09 2021

Keywords

Comments

See A341160 for an image of the square spiral tiling which shows the uncovered numbers in black.

Examples

			a(1) = 6 and a(2) = 19 as the first, third, fourth, and seventh square of A341160 cover the numbers (1), (5,18), (7,20), (40) respectively which leaves a gap containing numbers 6 and 19 which cannot be covered by any subsequence square.
		

Crossrefs

A341278 The smallest spiral number not covered by any square in the minimal-sum square spiral tiling by n X n squares in A341363.

Original entry on oeis.org

67, 173, 25, 30, 42, 56, 72, 90, 110, 132, 156, 182, 209, 239, 271, 305, 341, 379, 419, 461, 505, 551, 599, 649, 701, 755, 810, 860, 928, 990, 1054, 1120, 1188, 1258, 1330, 1404, 1480, 1558, 1638, 1720, 1804, 1890, 1978, 2067, 2159, 2253, 2349, 2447, 2547, 2649, 2753, 2859, 2967, 3077, 3189
Offset: 2

Views

Author

Scott R. Shannon, Feb 08 2021

Keywords

Comments

The tilings with n=2 and n=3 are the only ones where the smallest uncovered square is not adjacent to the first centrally placed tile. The sequence starts at n=2 as a 1 X 1 square tiling leaves no squares uncovered.
See A341363 for other images with higher numbers of placed tiles.

Crossrefs

A341363 Table read by antidiagonals: T(n, k) is the sum of the numbers inside the k-th square of size n X n when the square spiral is tiled with these squares, where each tile contains numbers which sum to the minimum possible value, and each number on the spiral can only be in one tile.

Original entry on oeis.org

1, 2, 10, 3, 48, 45, 4, 60, 276, 136, 5, 68, 321, 928, 325, 6, 80, 368, 1040, 2349, 666, 7, 92, 384, 1168, 2575, 4984, 1225, 8, 100, 429, 1296, 2825, 5382, 9391, 2080, 9, 124, 456, 1388, 3075, 5816, 10030, 16228, 3321, 10, 128, 554, 1656, 3627, 6250, 10718, 17190, 26257, 5050
Offset: 1

Views

Author

Scott R. Shannon, Feb 10 2021

Keywords

Comments

The terms for a given n tend to have larger jumps in value at one more than the square of the odd numbers, i.e., at k = (2*t+1)^2 + 1, t >= 0, due to the previous square filling a grid of squares containing (2*t+1)^2 squares. This forces the next square to move further away from the origin and into spiral arms containing larger numbers.
See A341278 for the smallest spiral number not covered by any square in each n X n tiling.

Examples

			The table begins:
     1,     2,     3,     4,     5,     6,     7,     8,     9,     10, ...
    10,    48,    60,    68,    80,    92,   100,   124,   128,    156, ...
    45,   276,   321,   368,   384,   429,   456,   554,   702,    803, ...
   136,   928,  1040,  1168,  1296,  1388,  1656,  1696,  1858,   2876, ...
   325,  2349,  2575,  2825,  3075,  3627,  3935,  4243,  4415,   7740, ...
   666,  4984,  5382,  5816,  6250,  8456,  9188,  9576, 10154,  14204, ...
  1225,  9391, 10030, 10718, 11406, 15006, 16260, 16737, 17627,  27701, ...
  2080, 16228, 17190, 18216, 19242, 24856, 26856, 27392, 28692,  49240, ...
  3321, 26257, 27636, 29096, 30556, 38998, 42010, 42561, 44383,  81527, ...
  5050, 40344, 42246, 44248, 46250, 58560, 62892, 63400, 65870, 127660, ...
  7381, 59459, 62002, 64666, 67330, 84806, 90808, 91201, 94459, 191129, ...
  ...
.
a(2,1) = 10 as the first square of size 2 X 2 is placed such that it covers the numbers 1,2,3,4, which sum to 10. This is the minimum possible sum.
a(2,2) = 48 as the second square of size 2 X 2 is placed such that it covers the numbers 5,6,18,19, which sum to 48. This is the minimum possible sum for such a square which does not use the previously covered numbers 1,2,3,4.
a(2,3) = 60 as the third square of size 2 X 2 is placed such that it covers the numbers 7,8,22,23, which sum to 60. This is the minimum possible sum for such a square which does not use the previously covered numbers 1,2,3,4,5,6,18,19.
		

Crossrefs

Formula

T(1,k) = k.
T(n,1) = n^2*(n^2+1)/2 = A000217(n^2).

A344046 Squares visited by a knight moving on a spirally numbered board where the knight moves to the smallest unvisited square using the fewest possible steps. If two or more equal length paths exist it chooses the path with the lowest sum of visited numbers, and if two paths have the same sum of visited numbers it chooses the one that visits the smallest number.

Original entry on oeis.org

1, 14, 5, 2, 15, 6, 3, 8, 11, 4, 7, 46, 9, 12, 53, 10, 51, 28, 13, 58, 33, 16, 19, 68, 17, 64, 35, 18, 69, 20, 23, 76, 21, 72, 41, 22, 77, 24, 27, 50, 25, 80, 47, 26, 83, 52, 29, 32, 57, 30, 89, 54, 31, 92, 59, 34, 97, 36, 39, 104, 37, 100, 63, 38, 105, 40, 107, 42, 45, 114, 43, 110, 71, 44, 115
Offset: 1

Views

Author

Scott R. Shannon, May 08 2021

Keywords

Comments

The knight starts on square 1 and then moves to the lowest unvisited square using the fewest possible steps. At the start the lowest unvisited square is the adjacent square numbered 2. This takes three steps, and there are twelve different 3-step paths that can be taken to reach it. The knight therefore chooses the path with the lowest sum of visited numbers, which is a step to 14, then 5, then to 2. The lowest unvisited square is now 3, and it can be reached in three steps, the lowest sum path of which is steps to 15, then 6, then 3. The next lowest unvisited square numbered 4 can be visited similarly, via 8 and 11. The next lowest unvisited square is now 7, as 5 and 6 have been visited in the previous steps, and from 4 the square numbered 7 can be reached in one step. After 7 the next lowest unvisited square is 9.
The sequence lists all the numbers visited by the knight using the above step rules.
The sequence is finite. After 929 total steps the square numbered 800 is reached, after which all eight neighboring squares of 800 have been visited, so the knight has no path to the next lowest unvisited square, which is 804.
The longest path between the previous and the next lowest unvisited square is an 11-step path between 281 to 300, via squares 432, 355, 522, 437, 360, 363, 446, 537, 450, 371. See the linked image.

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 the comments for a(1) to a(11).
a(12) = 46, a(13) = 9. After a(11) = 7 the next lowest unvisited square is 9, and that can be reached in two steps via 49 and then 9. No other 2-step path exists.
a(26) = 64, a(27) = 35, a(28) = 18. From a(25) = 17 the next lowest unvisited square is the adjacent square 18, which can be reached in three steps. Two paths exist which have a visited number sum of 117; one is 17 to 64 to 35 to 18, and the other is 17 to 62 to 37 to 18. As the first path visits 35, which is the smallest of the intermediate visited squares, that is the path chosen.
a(927) = 917, a(928) = 802, a(929) = 1043, a(930) = 800. From a(926) = 798 there are two 4-step paths to 800, and the chosen one has the lowest visit number sum. However after reaching 800 all eight neighboring squares of 800 have been visited, so the sequence terminates leaving 804 as the next lowest unvisited square.
		

Crossrefs

Previous Showing 11-20 of 22 results. Next