login
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.
2
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,2
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.
LINKS
Scott R. Shannon, Image of the path after 500000 steps. The colors are graduated across the spectrum to show the relative step order. Notice how the violet colored path, representing visited numbers after about 450000 steps, approaches the origin, marked with a white dot, via previously unvisited numbers.
EXAMPLE
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.
Sequence in context: A365436 A035047 A347335 * A334619 A037323 A065812
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Oct 29 2021
STATUS
approved