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.

Showing 1-1 of 1 results.

A348672 The numbers visited on a square spiral when stepping to the closest unvisited number such that the sum of that number and the current number is prime. If two or more such numbers exist then the smallest is chosen.

Original entry on oeis.org

1, 2, 3, 4, 15, 14, 33, 34, 13, 30, 29, 12, 11, 8, 9, 10, 27, 26, 47, 24, 23, 6, 5, 18, 19, 40, 39, 68, 69, 70, 43, 108, 71, 42, 41, 20, 21, 22, 7, 46, 25, 48, 49, 52, 51, 50, 81, 82, 169, 168, 221, 222, 167, 164, 117, 116, 77, 114, 113, 44, 45, 112, 111, 158, 159, 214, 277, 280, 351, 350, 281
Offset: 1

Views

Author

Scott R. Shannon, Oct 29 2021

Keywords

Comments

The path taken by the visited numbers approaches the spiral origin numerous times via unvisited squares for larger values of n. See the linked image. After 1 million steps the smallest unvisited number is 196, although it is possible this and similar smaller numbers are eventually visited for very large n.

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(2) = 2 as the three closest neighbors to 1 which when added to 1 form a prime are 2,4 and 6. Of those 2 is the smallest.
a(9) = 13 as the twelve closest numbers to 34 have either been visited or form a composite when added to 34. The closest and smallest unvisited number which forms a prime when added to 34 is 13.
		

Crossrefs

Cf. A348673 (add to composite), A332767, A338642, A000040.
Showing 1-1 of 1 results.