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
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Oct 29 2021
STATUS
approved