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.

A348673 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 composite. If two or more such numbers exist then the smallest is chosen.

Original entry on oeis.org

1, 8, 7, 20, 19, 6, 4, 5, 16, 17, 18, 39, 38, 37, 63, 36, 62, 61, 34, 15, 3, 12, 13, 14, 32, 31, 56, 55, 30, 54, 87, 88, 89, 130, 129, 177, 128, 127, 86, 85, 84, 51, 26, 25, 10, 11, 28, 27, 53, 52, 50, 49, 80, 79, 47, 46, 23, 22, 44, 21, 42, 43, 72, 71, 70, 41, 40, 68, 67, 66, 103, 102
Offset: 1

Views

Author

Scott R. Shannon, Oct 29 2021

Keywords

Comments

Despite the relative number of composite numbers increasing as n increases the path taken by the numbers still approaches the origin numerous times via unvisited squares for larger values of n. See the linked image. After 100 million steps the smallest unvisited number is 2; it is unknown if it is 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) = 8 as of the four closest neighbors to 1, namely 2,4,6 and 8, only 1+8=9 forms a composite number.
a(7) = 4 as the closest unvisited number to 6 is 5, but 6+5=11 is prime. The next two closest unvisited numbers are 4 and 18 both of which sum to composites, but 4 is chosen as that is the smaller of the two.
		

Crossrefs

Cf. A348672 (add to prime), A332767, A338642, A002808.
Showing 1-1 of 1 results.