A335364 The squares visited on the Ulam spiral when starting at square 1 and then stepping to the closest visible unvisited square which contains a prime number. If two or more visible squares are the same distance from the current square then the one with the smallest prime number is chosen.
1, 2, 3, 11, 29, 13, 31, 59, 89, 131, 179, 127, 83, 53, 5, 17, 37, 67, 103, 149, 101, 61, 97, 139, 191, 251, 193, 137, 313, 389, 311, 241, 307, 379, 461, 383, 467, 557, 463, 761, 653, 757, 647, 751, 863, 983, 643, 547, 457, 239, 181, 233, 173, 229, 293, 227, 223, 167, 521, 433, 353, 281
Offset: 1
Links
- Scott R. Shannon, Table of n, a(n) for n = 1..20001
- Scott R. Shannon, Image for the steps from n = 1 to 20001 with color. The starting square a(1) = 1 is shown as a white dot and the square a(20001) = 220019 is shown as a red dot. The smallest unvisited prime after 20000 steps, 107, is shown as a yellow dot. The color of each step is graduated across the spectrum from red to violet to show the relative visit order of the squares.
- Scott R. Shannon, Image for the steps from n = 1 to 5000000 with color. Note that some violet colored steps, corresponding to n values over 4000000, approach the origin, indicating earlier unvisited prime squares near the origin may eventually be visited after a large number of steps.
Comments