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

A347358 The prime numbers visited on a square spiral when starting at 1 and then stepping to the smallest unvisited prime number that is visible from the current number.

Original entry on oeis.org

1, 2, 3, 11, 5, 13, 29, 17, 7, 19, 31, 23, 37, 53, 41, 61, 43, 59, 47, 71, 83, 67, 89, 73, 101, 79, 107, 127, 97, 131, 103, 137, 109, 139, 113, 149, 173, 151, 179, 157, 181, 163, 191, 167, 193, 227, 197, 229, 293, 233, 211, 239, 199, 251, 223, 257, 307, 241, 311, 263, 313, 269, 317, 271, 331, 277
Offset: 1

Views

Author

Scott R. Shannon, Aug 28 2021

Keywords

Comments

A number is visible from the current number if, given it has coordinates (x,y) relative to the current number, the greatest common divisor of |x| and |y| is 1. See A331400 for the points visible from the starting 1 number.
The primes visited in the sequence appear to oscillate between two different regimes. In one the vast majority of the next smallest visible primes are on the corners of the neighboring inner or outer square ring of numbers, thus the steps are nearly vertical or horizontal relative to the current square. In the other the majority of next smallest visible primes are on square rings much closer or further away from the origin than the current ring, or entirely on the other side of the spiral relative to the starting number. In this regime the path makes very random steps in many different diagonal directions, covering the entire spiral. See the three linked images.

Examples

			The square spiral is numbered as follows:
.
  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 central starting number.
a(2) = 2, a(3) = 3 as 2 is the smallest visible unvisited prime from 1, and 3 is the smallest visible unvisited prime from 2.
a(4) = 11 as 11 is the smallest visible unvisited prime from 3. Note that from 3 the smaller unvisited primes 5 and 7 are hidden from 3 by the numbers 4 and 1.
a(7) = 29 as 29 is the smallest visible unvisited prime from 13. Note that from 13 the smaller unvisited primes 7, 17, 19, 23 are hidden from 13 by numbers 3, 14, 4, 2 respectively.
		

Crossrefs

Cf. A347522 (step to smallest hidden), A000040, A063826, A214664, A214665, A331400, A335364, A332767, A330979.

A079421 Spiro-Fibonacci differences, a(n) = difference of two previous terms that are nearest when terms arranged in a spiral.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1
Offset: 0

Views

Author

Neil Fernandez, Jan 07 2003

Keywords

Examples

			Terms are written in square boxes radiating spirally (cf. Ulam prime spiral). a(0)=0 and a(1)=1, so write 0 and then 1 to its right. a(2) goes in the box below a(1). The nearest two filled boxes contain a(0) and a(1), so a(2)=abs(a(0)-a(1))=abs(0-1)=1. a(3) goes in the box to the left of a(2). The nearest two filled boxes contain a(0) and a(2), so a(3)=abs(a(0)-a(2))=abs(0-1)=1.
		

Crossrefs

A094768 Square spiral of sums of selected preceding terms, starting at 1 (a spiral Fibonacci-like sequence).

Original entry on oeis.org

1, 1, 2, 3, 6, 9, 16, 25, 42, 68, 110, 179, 291, 470, 763, 1236, 2005, 3241, 5252, 8502, 13770, 22272, 36058, 58355, 94455, 152878, 247333, 400279, 647722, 1048180, 1696193, 2744373, 4440857, 7185700, 11627320, 18814256, 30443581, 49257837
Offset: 1

Views

Author

Yasutoshi Kohmoto, Jun 10 2004

Keywords

Comments

Enter 1 into center position of the spiral. Repeat: Add to the number in the present position the numbers in all those already filled positions that are horizontally or vertically adjacent to it, go to next position of the spiral and enter the sum into it.
a(1) = 1, a(n) = a(n-1) + Sum_{i < n-1 and a(i) is adjacent to a(n-1)} a(i).
Here only four positions are considered adjacent, eight however in A094767.
Clockwise and counterclockwise construction of the spiral result in the same sequence.

Examples

			Clockwise constructed spiral begins
.
  13770--22272--36058--58355--94455
      |
      |
   8502     16-----25-----42-----68
      |      |                    |
      |      |                    |
   5252      9      1------1    110
      |      |             |      |
      |      |             |      |
   3241      6------3------2    179
      |                           |
      |                           |
   2005---1236----763----470----291
.
where
  a(2) = a(1) = 1,
  a(3) = a(2) + a(1) = 2,
  a(4) = a(3) + a(2) = 3,
  a(5) = a(4) + a(3) + a(1) = 6,
  a(6) = a(5) + a(4) = 9,
  a(7) = a(6) + a(5) + a(1) = 16.
		

Crossrefs

Programs

  • PARI
    {m=5; h=2*m-1; A=matrix(h, h); print1(A[m, m]=1, ","); pj=m; pk=m; T=[[1, 0], [0, -1], [ -1, 0], [0, 1]]; for(n=1, (h-2)^2-1, g=sqrtint(n); r=(g+g%2)\2; q=4*r^2; d=n-q; if(n<=q-2*r, j=d+3*r; k=r, if(n<=q, j=r; k=-d-r, if(n<=q+2*r, j=r-d; k=-r, j=-r; k=d-3*r))); j=j+m; k=k+m; s=A[pj, pk]; for(c=1, 4, v=[pj, pk]; v+=T[c]; s=s+A[v[1], v[2]]); A[j, k]=s; print1(s, ","); pj=j; pk=k)} \\ Klaus Brockhaus, Aug 27 2008

Extensions

Edited and extended beyond a(14) by Klaus Brockhaus, Aug 27 2008

A214666 The x-coordinates of prime numbers in an Ulam spiral oriented counterclockwise with first step west.

Original entry on oeis.org

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

Views

Author

William Rex Marshall, Jul 26 2012

Keywords

Comments

The eight possible orientations of the Ulam spiral can be derived from combining either A214664 or A214666 with either A214665 or A214667 as ordered pairs of coordinates.
This spiral is rotated 180 degrees from the spiral on the March 1964 cover of Scientific American.

Crossrefs

A214667 The y-coordinates of prime numbers in an Ulam spiral oriented counterclockwise with first step west.

Original entry on oeis.org

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

Views

Author

William Rex Marshall, Jul 26 2012

Keywords

Comments

The eight possible orientations of the Ulam spiral can be derived from combining either A214664 or A214666 with either A214665 or A214667 as ordered pairs of coordinates.
This spiral is rotated 180 degrees from the spiral on the March 1964 cover of Scientific American.

Crossrefs

A336402 Squares visited by a chess queen moving on a square-spiral numbered board where the queen moves to the closest unvisited square containing a prime number. In case of a tie it chooses the square with the smallest prime number.

Original entry on oeis.org

1, 2, 3, 11, 29, 13, 31, 59, 61, 97, 139, 191, 251, 193, 101, 103, 67, 37, 17, 5, 19, 7, 23, 47, 79, 163, 281, 353, 283, 433, 521, 617, 523, 619, 439, 359, 223, 167, 227, 293, 229, 173, 83, 233, 127, 53, 179, 131, 89, 137, 389, 313, 311, 467, 383, 307, 241, 239, 181, 457, 547, 643
Offset: 1

Views

Author

Scott R. Shannon, Jul 20 2020

Keywords

Comments

This sequences gives the numbers of the squares visited by a chess queen moving on a square-spiral numbered board where the queen starts on the 1 numbered square and at each step moves to the closest unvisited square containing a prime number. The movement is restricted to the eight directions a queen can move on a standard chess board, and the queen cannot move over a previously visited square If two or more unvisited prime numbered squares exist which are the same distance from the current square then the one with the smallest prime number is chosen. Note that if the queen simply moves to the closest unvisited square the sequence will be infinite as the queen will just follow the square spiral path.
The sequence is finite. After 519 steps the square with number 1289 is visited, after which all eight squares the queen can move to have been visited.
The first term where this sequence differs from A330979, which steps to the closest unvisited prime without any movement direction restrictions, is a(40) = 227. See the examples below.
The largest visited square is a(292) = 14843. The largest step distance between visited squares is 20 units, between a(338) = 2879 to a(339) = 3779. The largest prime gap between visited squares is 4050, from a(396) = 10667 to a(397) = 14717. The smallest unvisited prime is 41.

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 queen.
a(2) = 2. The seven unvisited prime numbered squares around a(1) the queen can move to are numbered 2,3,61,5,19,7,23. Of these 2 is the closest, being 1 unit away. There are no primes in the south-east direction from a(1).
a(4) = 11. The four unvisited prime numbered squares around a(3) = 3 the queen can move to are numbered 11,29,13,5, the other two directions not having any primes. Both 11 and 13 are sqrt(2) units away, and of those 11 is the smallest.
a(40) = 227. The three unvisited prime numbered squares around a(39) = 167 the queen can move to are numbered 227,173,53, Of these 227 is the closest, being 4 units away. Note that the square with prime number 83 is only sqrt(10), about 3.16, units away but is at relative coordinates (1,3) to 167 so cannot be reach by the queen.
		

Crossrefs

A336446 Squares visited by a chess queen moving on a square-spiral numbered board where the queen moves to an unvisited square containing the smallest prime number.

Original entry on oeis.org

1, 2, 3, 5, 7, 19, 17, 13, 11, 23, 47, 43, 41, 37, 31, 29, 53, 127, 79, 73, 71, 67, 103, 101, 97, 61, 59, 131, 89, 83, 173, 167, 163, 157, 151, 107, 109, 271, 211, 199, 197, 193, 191, 139, 137, 239, 181, 179, 641, 457, 241, 251, 257, 263, 149, 397, 389, 313, 311, 307, 293, 113, 281
Offset: 1

Views

Author

Scott R. Shannon, Jul 22 2020

Keywords

Comments

This sequences gives the numbers of the squares visited by a chess queen moving on a square-spiral numbered board where the queen starts on the 1 numbered square and at each step moves to an unvisited square containing the smallest prime number. The movement is restricted to the eight directions a queen can move on a standard chess board, and the queen cannot move over a previously visited square. Note that if the queen simply moves to an unvisited square containing the smallest number the sequence will be infinite as the queen will just follow the square spiral path.
The sequence is finite. After 5880 steps the square with number 55903 is visited, after which all eight squares the queen can move to have been visited.
The first term where this sequence differs from A336402, where the queen steps to the closest unvisited prime, is a(4) = 5. See the examples below.
The largest visited square is a(4943) = 79187. The largest step distance between visited squares is 72 units, between a(3205) = 31397 to a(3206) = 31469. The largest prime gap between visited squares is 30150, from a(4942) = 49037 to a(4943) = 79187. The smallest unvisited prime is 45833.

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 queen.
a(2) = 2. The seven unvisited prime numbered squares around a(1) the queen can move to are numbered 2,3,61,5,19,7,23. Of these 2 is the smallest. There are no primes in the south-east direction from a(1).
a(4) = 5. The four unvisited prime numbered squares around a(3) = 3 the queen can move to are numbered 11,29,13,5, the other two available directions not having any primes. Of these 5 is the smallest. Note that 11 is the closest prime, being only sqrt(2) units away while 5 is 2 units away.
a(4943) = 79187. This is only unvisited square containing a prime number around a(4942) = 49037. It is 30 units away to the right.
		

Crossrefs

A344659 Lexicographically earliest sequence of distinct nonnegative terms on a square spiral such that each term forms no prime value in the eight sums when each term is added to each of its eight nearest neighbors.

Original entry on oeis.org

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

Views

Author

Eric Angelini and Scott R. Shannon, May 26 2021

Keywords

Comments

.
36--33--35--34--32--30--24
| |
41 16--11--10--12---2 26
| | | |
40 22 4--14---8 13 31
| | | | | |
42 18 6 0---1 7 27
| | | | |
39 3 9--15--20---5 23 .
| | | .
37 17--19--25--29--28--21 .
| |
38--43--45--47--49--53--57--48
.

Examples

			The eight terms that are in contact with the initial zero are 1, 8, 14, 4, 6, 9, 15, 20: none of them is prime [forcing the sum a(k) + 0 to be nonprime, with k<9]; more generally, no term of the square spiral when added to any of its eight nearest neighbors sums to a prime.
		

Crossrefs

A335710 The smallest number on a square (Ulam) spiral in a 2D grid such that n steps in one of the four axial directions leads to each visited number sharing a common factor greater than 1 with the previous visited number.

Original entry on oeis.org

1, 3, 30, 1235, 2439, 90000, 88805, 4330458, 4322139, 22001763, 21983004, 1868098088, 2436807593
Offset: 0

Views

Author

Scott R. Shannon, Jun 18 2020

Keywords

Comments

Start with any number on a square (Ulam) spiral in a 2D grid and then continue to step right to the next square as long as the number in that square shares a common factor > 1 with the number in the current square. Count the steps one can take. Repeat this process in each of the other three axial directions left, upward and downward, and then take the maximum step length of these four directions. The sequence a(n) gives the smallest number such that the maximum step length of these four directions is n.
If a(13) exists it is greater than 5*10^11.

Examples

			a(0) = 1 as 1 has no common factor > 1 with its neighboring four squares.
a(1) = 3 as stepping right one step from 3 leads to 12 which shares the common factor 3.
a(2) = 30 as stepping right two steps from 30 leads to 55 and 88 which share the common factors 5 and 11 respectively.
a(3) = 1235 as stepping right three steps from 1235 leads to 1380, 1533, 1694 which share the common factors 5, 3, 7 respectively.
a(4) = 2439 as stepping right four steps from 2439 leads to 2640, 2849, 3066, 3291 which share the common factors 3, 11, 7, 3 respectively.
a(5) = 90000 as stepping upward five steps from 90000 leads to 91203, 92414, 93633, 94860, 96095 which share common factors 3, 7, 23, 3, 5 respectively.
a(6) = 88805 as stepping upward one step from 88805 leads to 90000, which shares a common factor 5, and then continues upwards with the same five steps as a(5).
a(7) = 4330458 as stepping downward seven steps from 4330458 leads to 4338785, 4347120, 4355463, 4363814, 4372173, 4380540, 4388915 which share common factors 11, 5, 3, 7, 13, 3, 5 respectively.
a(8) = 4322139 as stepping downward one step from 4322139 leads to 4330458, which shares a common factor 3, and then continue downward with the same seven steps as a(7).
a(9) = 22001763 as stepping downward nine steps from 22001763 leads to 22020530, 22039305, 22058088, 22076879, 22095678, 22114485, 22133300, 22152123, 22170954 which share common factors 7, 5, 3, 19, 11, 3, 5, 7, 3 respectively.
a(10) = 21983004 as stepping downward one step from 21983004 leads to 22001763, which shares a common factor 3, and then continue downward with the same nine steps as a(9).
a(11) = 1868098088 as stepping upward eleven steps from 1868098088 leads to 1868270979, 1868443878, 1868616785, 1868789700, 1868962623, 1869135554, 1869308493, 1869481440, 1869654395, 1869827358, 1870000329 which share common factors 23, 3, 7, 5, 3, 11, 13, 3, 5, 7, 3 respectively.
a(12) = 2436807593 as stepping left twelve steps from 2436807593 leads to 2437005054, 2437202523, 2437400000, 2437597485, 2437794978, 2437992479, 2438189988, 2438387505, 2438585030, 2438782563, 2438980104, 2439177653 which share common factors 11, 3, 7, 5, 3, 23, 13, 3, 5, 7, 3, 11 respectively.
		

Crossrefs

A338642 Square spiral of smallest distinct positive integers starting at 1 such that the four sums of each term with its four nearest neighbors are composite numbers.

Original entry on oeis.org

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

Views

Author

Eric Angelini and Scott R. Shannon, Apr 21 2021

Keywords

Examples

			The square spiral starts:
.
     38--36--34--35--33--30--32
      |                       |
     39  16--18--15--13--14  31
      |   |               |   |
     37  19   2---7---5  10  29
      |   |   |       |   |   |
     40  17   8   1---3  12  27
      |   |   |           |   |
     41  21   4--11---9---6  28
      |   |                   |
     43  23--22--24--25--20--26
      |
     42--45--46--44--47--48--50..
.
a(2) = 3 as a(1) + 3 = 1 + 3 = 4, the smallest possible composite number.
a(3) = 5 as a(2) + 5 = 3 + 5 = 8. Note a(3) cannot be 2 or 4 as when these are added to 3 the result is a prime number.
a(4) = 7 as a(3) + 7 = 5 + 7 = 12, and a(1) + 7 = 1 + 7 = 8, both being composite.
a(9) = 9 as a(8) + 9 = 11 + 9 = 20, and a(2) + 9 = 3 + 9 = 12, both being composite.
		

Crossrefs

Cf. A338644 (sum to primes), A002808, A063826, A260643, A334742, A307834, A338221.
Previous Showing 21-30 of 49 results. Next