OFFSET
1,2
COMMENTS
A number is visible from the current number if, given it has coordinates (x,y) relative to the current number, the greatest common divisor of |x| and |y| is 1. See A331400 for the points visible from the starting 1 number.
The primes visited in the sequence appear to oscillate between two different regimes. In one the vast majority of the next smallest visible primes are on the corners of the neighboring inner or outer square ring of numbers, thus the steps are nearly vertical or horizontal relative to the current square. In the other the majority of next smallest visible primes are on square rings much closer or further away from the origin than the current ring, or entirely on the other side of the spiral relative to the starting number. In this regime the path makes very random steps in many different diagonal directions, covering the entire spiral. See the three linked images.
LINKS
Scott R. Shannon, Image of the path for the first 7000 terms. The colors are graduated across red, orange, yellow to show the relative step order. Note the yellow lines, terms in the 5000-7000 range, step in all directions across the entire spiral.
Scott R. Shannon, Image of the path for the first 14000 terms. The colors are now graduated across red, orange, yellow, green, blue. Note how the steps for the later colors, terms in the 1000-14000 range, are almost all horizontal or vertical and none step diagonally into the inner spiral.
Scott R. Shannon, Image of the path for the first 21000 terms. The colors are now graduated across red, orange, yellow, green, blue, indigo, violet. Note how the later colors, terms in the 15000-21000 range, again behave like the earlier 5000-7000 term range and step in random directions across the spiral.
Eric Weisstein's World of Mathematics, Visible Point.
Wikipedia, Ulam Spiral.
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(1) = 1. The central starting number.
a(2) = 2, a(3) = 3 as 2 is the smallest visible unvisited prime from 1, and 3 is the smallest visible unvisited prime from 2.
a(4) = 11 as 11 is the smallest visible unvisited prime from 3. Note that from 3 the smaller unvisited primes 5 and 7 are hidden from 3 by the numbers 4 and 1.
a(7) = 29 as 29 is the smallest visible unvisited prime from 13. Note that from 13 the smaller unvisited primes 7, 17, 19, 23 are hidden from 13 by numbers 3, 14, 4, 2 respectively.
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Aug 28 2021
STATUS
approved