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 51-60 of 81 results. Next

A380812 Sequence of x-coordinates of the lexicographically earliest (according to the spiral numbering of the square grid; see comments) infinite Racetrack trajectory (using von Neumann neighborhood) on the square grid.

Original entry on oeis.org

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

Views

Author

Pontus von Brömssen, Feb 05 2025

Keywords

Comments

The car starts at the origin and thereafter moves, according to the rules of Racetrack with von Neumann neighborhood (see A351042 or Wikipedia link), to the unvisited square that has the lowest spiral number, provided that it is possible to extend the trajectory to an infinite one. The spiral numbering is described in A316328.
The trajectory in A351043 is defined in a similar way, but it does not backtrack when it gets stuck, so it is finite, ending after 146 steps. The trajectory here is identical to the trajectory in A351043 for the first 144 steps.

Examples

			In the 144th step, the car moves from (-9,-8) to (-6,-6) (a(144) = A380813(144) = -6). A priori, the next possible positions (ordered by increasing spiral number) are (-3,-3), (-4,-4), (-3,-4), (-2,-4), and (-3,-5). Of these, (-3,-3) has already been visited (after the 103rd step), so the next choice is (-4,-4). From that position, however, the car is forced to move to (-2,-2) (all other alternatives have already been visited), and from (-2,-2) there are no available positions not already visited (so the trajectory in A351043 ends there). The next option (-3,-4) is also a dead end, but from (-2,-4) it is possible to continue forever, so a(145) = -2 and A380813(145) = -4.
		

Crossrefs

Cf. A174344, A316328, A351042, A351043, A380813 (y-coordinates), A380814.

Formula

a(n) = A174344(A351043(n)+1) for n <= 144.

A324606 The x-coordinates of squares visited by knight moves on a spirally numbered board and moving to the lowest available unvisited square at each step.

Original entry on oeis.org

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

Views

Author

Peter Kagey, Jun 06 2019

Keywords

Crossrefs

A324607 gives y-coordinates.

Formula

a(n) = A174344(A316667(n)).

A332582 Label the cells of the infinite 2D square lattice with the square spiral (or Ulam spiral), starting with 1 at the center; sequence lists primes that are visible from square 1.

Original entry on oeis.org

2, 3, 5, 7, 29, 41, 47, 83, 89, 97, 103, 107, 109, 113, 173, 179, 181, 191, 193, 199, 223, 293, 311, 317, 347, 353, 359, 443, 449, 457, 461, 467, 479, 487, 491, 499, 503, 509, 521, 523, 631, 641, 643, 647, 653, 659, 661, 673, 683, 691, 701, 709, 719, 727, 857, 863, 887, 929, 947, 953, 1091
Offset: 1

Views

Author

Scott R. Shannon, Feb 17 2020

Keywords

Comments

Any grid point with relative coordinates (x,y) from the central grid point, which is numbered 1, and where the greatest common divisor (gcd) of |x| and |y| equals 1 will be visible from the central point. Grid points where gcd(|x|,|y|) > 1 will have another point directly between it and the central point and will thus not be visible. In an infinite 2D square lattice the ratio of visible grid points to all points is 6/Pi^2, approximately 0.608, the same as the probability of two random numbers being relative prime.
For a square spiral of size 10001 X 10001, slightly over 100 million numbers, a total of 60803664 numbers are visible, of which 2155170 are prime. The total number of primes in the same range is 5762536, giving a ratio of visible primes to all primes of about 0.374. This is significantly lower than the ratio for all numbers of 0.608, indicating a prime is more likely to be hidden from the origin than a random number.
Primes p such that A174344(p) and A268038(p) are coprime. - Robert Israel, Feb 16 2024

Examples

			The 2D grid is shown below. Composite numbers are shown as a '*'. The primes that are blocked from the central 1 square are in parentheses; these all have another composite or prime number directly between their position and the central square.
.
.
    *----*----*--(61)---*--(59)---*----*
                                       |
  (37)---*----*----*----*----*--(31)   *
    |                             |    |
    *  (17)---*----*----*--(13)   *    *
    |    |                   |    |    |
    *    *    5----*----3    *   29    *
    |    |    |         |    |    |    |
    *  (19)   *    1----2  (11)   *  (53)
    |    |    |              |    |    |
   41    *    7----*----*----*    *    *
    |    |                        |    |
    *    *----*--(23)---*----*----*    *
    |                                  |
  (43)---*----*----*---47----*----*----*
.
.
a(1) = 2 to a(4) = 7 are all primes adjacent to the central 1 point, thus all are visible from that square.
a(5) = 29 as primes 11, 13, 17, 19, 23 are blocked from the central 1 point by points numbered 2, 3, 5, 6, 8 respectively.
		

Crossrefs

Programs

  • Maple
    x:= 0: y:= 0: R:= NULL: count:= 0:
    for i from 2 while count < 100 do
      if x >= y then
        if x < -y + 1 then x:= x+1
        elif x > y then y:= y+1
        else x:= x-1
        fi
      elif x <= -y then y:= y-1
        else x:= x-1
      fi;
      if isprime(i) and igcd(abs(x),abs(y))=1 then R:= R,i; count:= count+1 fi
    od:
    R; # Robert Israel, Feb 16 2024

A333835 Lexicographically earliest sequence of distinct positive integers, which when mapped onto a square spiral, gives a set without three distinct evenly spaced aligned points.

Original entry on oeis.org

1, 2, 3, 4, 17, 18, 20, 21, 22, 24, 27, 28, 31, 33, 34, 61, 80, 81, 87, 90, 93, 100, 131, 135, 145, 146, 148, 152, 154, 157, 158, 160, 166, 171, 172, 174, 189, 194, 225, 253, 268, 270, 271, 276, 281, 282, 291, 294, 295, 298, 316, 335, 338, 368, 383, 397, 405
Offset: 1

Views

Author

Rémy Sigrist, Apr 07 2020

Keywords

Comments

This sequence has similarities with A005836 and A229037.

Examples

			The first terms, mapped onto a square spiral, are:
         *---*---*---*--61---*---*---*---*
         |                               |
         *   *---*---*--34--33---*--31   *
         |   |                       |   |
         *   *  17---*---*---*---*   *   *
         |   |   |               |   |   |
         *   *  18   *---4---3   *   *   *
         |   |   |   |       |   |   |   |
         *   *   *   *   1---2   *  28   *
         |   |   |   |           |   |   |
         *   *  20   *---*---*---*  27   *
         |   |   |                   |   |
         *   *  21--22---*--24---*---*   *
         |   |                           |
         *   *---*---*---*---*---*---*---*
         |
         *---*---*---*---*---*---*--80--81
		

Crossrefs

See A333825 for a similar sequences.

A333866 Lexicographically earliest sequence of distinct positive integers, which when mapped onto a square spiral, gives a set without four distinct points forming a square.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 17, 18, 20, 21, 26, 27, 30, 31, 37, 38, 41, 43, 44, 46, 50, 52, 55, 57, 58, 65, 66, 70, 73, 79, 82, 83, 88, 91, 92, 101, 102, 104, 110, 111, 116, 122, 124, 127, 132, 133, 141, 143, 145, 146, 152, 156, 157, 167, 170, 171, 180
Offset: 1

Views

Author

Rémy Sigrist, Apr 08 2020

Keywords

Comments

This sequence has similarities with A005282.

Examples

			The first terms, mapped onto a square spiral, are:
        65---*---*---*---*---*---*--58--57
         |                               |
        66  37---*---*---*---*---*--31   *
         |   |                       |   |
         *  38  17---*---*--14--13  30  55
         |   |   |               |   |   |
         *   *  18   5---*---3   *   *   * <-- As the sequence contains 2, 13
         |   |   |   |       |   |   |   |     and 27, it cannot contain 54.
         *   *   *   6   1---2  11   *   *
         |   |   |   |           |   |   |
        70  41  20   7---*---*--10  27  52
         |   |   |                   |   |
         *   *  21---*---*---*---*--26   *
         |   |                           |
         *  43--44---*--46---*---*---*--50
         |
        73---*---*---*---*---*--79---*---*
		

Crossrefs

See A333825 for a similar sequences.

A334745 Starting with a(1) = a(2) = 1, proceed in a square spiral, computing each term as the sum of diagonally adjacent prior terms.

Original entry on oeis.org

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

Views

Author

Alec Jones and Peter Kagey, May 09 2020

Keywords

Examples

			Spiral begins:
... 3---3---3---3---1
                    |
1---1---2---2---1   1
|               |   |
2   1---1---1   1   3
|   |       |   |   |
2   1   1---1   2   2
|   |           |   |
1   1---2---1---1   3
|                   |
1---3---2---3---1---1
The last illustrated term above is a(35) = 3 = 2 + 1 because diagonally down-right is 2 and diagonally down-left is 1.
		

Crossrefs

The x- and y-coordinates at n-th step are A174344 and A274923 respectively.

Formula

Conjecture: a(2n-1) = A247976(n).

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

A360170 a(n) is the X-coordinate after n steps of an infinite knight's tour through all lattice points; see A360171 for the Y-coordinates.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jan 28 2023

Keywords

Comments

See A068608 for similar sequences.

Examples

			See illustration of the first steps in Links section.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) = A174344(A068613(n+1)).

A361374 Make a square spiral starting with a(1)=1, a(2)=2. Then, each position gets the smallest unused number which is the sum of a path of numbers starting from that position.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 74
Offset: 1

Views

Author

Samuel Harkness, Mar 28 2023

Keywords

Comments

A path can go in any cardinal direction or diagonal. A path may not repeat the same number.
For a while, this sequence seems to simply be the natural numbers. However, the percentage of natural numbers in this sequence tends to 0. E.g., only 2347 of the first million natural numbers are in this sequence.
a(73) = 72 is the first to break from the natural numbers. 97 is the least positive number which does not occur.

Examples

			For a(42), the first candidate to check is 42, as it is the least unused positive integer. 20-22 is a valid path which ends at a(42) and whose sum is 42, so a(42) = 42. (path shown below)
.
   37   36   35   34   33   32   31
.
   38   17   16   15   14   13   30
.
   39   18    5    4    3   12   29
.
   40   19    6    1    2   11   28
.
   41   20    7    8    9   10   27
.     /    \
 start  21   22   23   24   25   26
.
For a(73), the first candidate to check is 73, as it is the least unused positive integer. No paths starting at a(73) equal 73, so check the next candidate, 74. 43-21-7-1-2 is a valid path starting at a(73) and whose sum is 74, so a(73) = 74. (path shown below)
.
   65   64   63   62   61   60   59   58   57
.
   66   37   36   35   34   33   32   31   56
.
   67   38   17   16   15   14   13   30   55
.
   68   39   18    5    4    3   12   29   54
.
   69   40   19    6    1----2   11   28   53
.                     /
   70   41   20    7    8    9   10   27   52
.               /
   71   42   21   22   23   24   25   26   51
.          /
   72   43   44   45   46   47   48   49   50
      /
 start
.
The first 144 terms:
.
  164-162-159-155-153-152-151-149-148-147-146-158
                                                |
  102-100--99--96--94--93--92--91--90--89-101 154
    |                                       |   |
  103  65--64--63--62--61--60--59--58--57  98 150
    |   |                               |   |   |
  104  66  37--36--35--34--33--32--31  56  95 141
    |   |   |                       |   |   |   |
  105  67  38  17--16--15--14--13  30  55  85 140
    |   |   |   |               |   |   |   |   |
  106  68  39  18   5---4---3  12  29  54  84 139
    |   |   |   |   |       |   |   |   |   |   |
  107  69  40  19   6   1---2  11  28  53  82 135
    |   |   |   |   |           |   |   |   |   |
  108  70  41  20   7---8---9--10  27  52  81 134
    |   |   |   |                   |   |   |   |
  110  71  42  21--22--23--24--25--26  51  88 133
    |   |   |                           |   |   |
  112  72  43--44--45--46--47--48--49--50  87 138
    |   |                                   |   |
  114  74--73--75--76--77--78--79--80--83--86 137
    |                                           |
  117-116-118-119-120-121-122-124-126-128-132-136
.
Note that 97 does not (and will not) occur. A path must start with one of the outer-most cells, all of which are greater than 97, and nothing below their minimum can ever be reached again.
		

Crossrefs

Cf. A174344, A274923 (spiral coordinates).

Programs

  • MATLAB
    See Links section.

A361702 Lexicographically earliest sequence of positive numbers on a square spiral such that no four equal numbers lie on the circumference of a circle.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 3, 3, 1, 3, 3, 3, 2, 2, 3, 2, 4, 4, 4, 2, 1, 2, 3, 4, 3, 4, 4, 5, 5, 5, 5, 1, 1, 5, 4, 3, 4, 6, 5, 6, 6, 4, 3, 2, 1, 5, 4, 1, 6, 3, 4, 2, 5, 6, 5, 6, 7, 6, 7, 3, 1, 5, 7, 7, 6, 4, 6, 5, 7, 6, 4, 7, 8, 7, 6, 7, 4, 7, 5, 8, 8, 8, 6, 3, 6, 4, 8, 5, 8, 9, 9, 7, 8, 3
Offset: 1

Views

Author

Scott R. Shannon, Mar 21 2023

Keywords

Comments

The first term a(1) = 1 lies at the (0,0) origin while all other terms lie on integer coordinates.

Examples

			a(4) = 2 as a(1) = a(2) = a(3) = 1 all lie on the circumference of a circle with radius 1/sqrt(2) centered at (1/2,1/2), assuming a counter-clockwise spiral, so a(4) cannot be 1.
a(12) = 3 as a(2) = a(3) = a(11) = 1 all lie on the circumference of a circle with radius 1/sqrt(2) centered at (3/2,1/2), so a(12) cannot be 1, while a(4) = a(8) = a(10) = 2 all lie on the circumference of a circle with radius sqrt(2) centered at (1,0), so a(12) cannot be 2.
a(22) = 4 as a(1) = a(2) = a(7) = 1 all lie on the circumference of a circle with radius sqrt(10)/2 centered at (1/2,-3/2), so a(22) cannot be 1, a(6) = a(19) = a(21) = 2 all lie on the circumference of a circle with radius sqrt(5)/2 centered at (-3/2,-1), so a(22) cannot be 2, while a(12) = a(16) = a(20) = 3 all lie on the circumference of a circle with radius sqrt(5) centered at (0,0), so a(22) cannot be 3.
		

Crossrefs

Previous Showing 51-60 of 81 results. Next