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

A343031 Table read by antidiagonals: T(n, k) is the sum of the numbers on the k-th line of length n when these lines are drawn on 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.

Original entry on oeis.org

1, 2, 3, 3, 7, 9, 4, 11, 12, 20, 5, 15, 24, 24, 39, 6, 19, 33, 34, 42, 67, 7, 23, 42, 58, 54, 71, 107, 8, 27, 54, 74, 75, 81, 110, 160, 9, 31, 66, 90, 115, 105, 122, 164, 229, 10, 35, 75, 110, 140, 141, 143, 174, 232, 315, 11, 39, 84, 130, 165, 201, 183, 198, 244, 319, 421
Offset: 0

Views

Author

Scott R. Shannon, Apr 03 2021

Keywords

Comments

Lines of length zero (a single point) and one (two points) can cover the entire square spiral without missing any numbers.
For lines with even numbered length the pattern of lines is very regular, with all lines along the spiral lines of the square spiral, and regular triangles of uncovered numbers along the four diagonals of the spiral. See the linked images with even n.
For odd length lines the pattern formed is more random, with some quadrants have regions, or the entire quadrant, with lines that are orthogonal to the spiral lines, and the triangles of uncovered values becomes more random along the spiral diagonals. See the linked images with odd n.
For n>=2 the smallest spiral number that is not covered by any line is n^2+4n+4.

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
.
The table begins:
    1,   2,   3,   4,   5,   6,   7,   8,    9,   10,   11,   12, ...
    3,   7,  11,  15,  19,  23,  27,  31,   35,   39,   43,   47, ...
    9,  12,  24,  33,  42,  54,  66,  75,   84,   96,  105,  114, ...
   20,  24,  34,  58,  74,  90, 110, 130,  154,  178,  194,  210, ...
   39,  42,  54,  75, 115, 140, 165, 195,  225,  260,  295,  335, ...
   67,  71,  81, 105, 141, 201, 237, 273,  315,  357,  405,  453, ...
  107, 110, 122, 143, 183, 238, 322, 371,  420,  476,  532,  595, ...
  160, 164, 174, 198, 234, 294, 372, 484,  548,  612,  684,  756, ...
  229, 232, 244, 265, 305, 360, 444, 549,  693,  774,  855,  945, ...
  315, 319, 329, 353, 389, 449, 527, 639,  775,  955, 1055, 1155, ...
  421, 424, 436, 457, 497, 552, 636, 741,  885, 1056, 1276, 1397, ...
  548, 552, 562, 586, 622, 682, 760, 872, 1008, 1188, 1398, 1662, ...
		

Crossrefs

Formula

T(0,k) = k.
T(1,k) = 3 + 4(k-1).

A344129 The minimum number of steps required for a knight, starting at the central square numbered 1, to reach the square numbered n on a square-spiral numbered board.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, May 10 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(1) = 0 as the knight starts at the central square numbered 1.
a(2) = 3 as it requires 3 steps for a knight to move to any of the four adjacent squares. An example path is 1 - 12 - 15 - 2.
a(3) = 2 as it requires 2 steps for a knight to move to any of the four diagonally adjacent squares. An example path is 1 - 10 - 3.
a(10) = 1 as the square numbered 10, along with the squares numbered 12, 14, 16, 18, 20, 22, 24, are one direct knight leap away from the starting square.
a(13) = 4 as it requires 4 steps for a knight to move to any of the four squares diagonally two squares away. An example path is 1 - 14 - 11 - 4 - 13.
		

Crossrefs

Programs

  • Python
    # uses get_coordinate(n) in A296030
    KM=[(2, 1), (1, 2), (-1, 2), (-2, 1), (-2, -1), (-1, -2), (1, -2), (2, -1)]
    def next_moves(i, j): return [(i+k, j+m) for k, m in KM]
    def a(n):
        start, goal, steps = (0, 0), get_coordinate(n), 0
        reach, expand = {start}, {start}
        while goal not in reach:
            reach1 = set(m for i, j in expand for m in next_moves(i, j))
            expand = reach1 - reach
            steps, reach, reach1 = steps + 1, reach | reach1, set()
        return steps
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Jun 15 2021
Previous Showing 21-22 of 22 results.