OFFSET
1,2
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.
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 green and purple colored paths, representing visited numbers after about 250000 and 450000 steps, approach 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) = 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
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Oct 29 2021
STATUS
approved