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.
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
Keywords
Examples
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.
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.
Comments