A332582 Label the cells of the infinite 2D square lattice with the square spiral (or Ulam spiral), starting with 1 at the center; sequence lists primes that are visible from square 1.
2, 3, 5, 7, 29, 41, 47, 83, 89, 97, 103, 107, 109, 113, 173, 179, 181, 191, 193, 199, 223, 293, 311, 317, 347, 353, 359, 443, 449, 457, 461, 467, 479, 487, 491, 499, 503, 509, 521, 523, 631, 641, 643, 647, 653, 659, 661, 673, 683, 691, 701, 709, 719, 727, 857, 863, 887, 929, 947, 953, 1091
Offset: 1
Keywords
Examples
The 2D grid is shown below. Composite numbers are shown as a '*'. The primes that are blocked from the central 1 square are in parentheses; these all have another composite or prime number directly between their position and the central square. . . *----*----*--(61)---*--(59)---*----* | (37)---*----*----*----*----*--(31) * | | | * (17)---*----*----*--(13) * * | | | | | * * 5----*----3 * 29 * | | | | | | | * (19) * 1----2 (11) * (53) | | | | | | 41 * 7----*----*----* * * | | | | * *----*--(23)---*----*----* * | | (43)---*----*----*---47----*----*----* . . a(1) = 2 to a(4) = 7 are all primes adjacent to the central 1 point, thus all are visible from that square. a(5) = 29 as primes 11, 13, 17, 19, 23 are blocked from the central 1 point by points numbered 2, 3, 5, 6, 8 respectively.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
- Scott R. Shannon, Image showing the visible primes from point 1 for the first 100000 grid points. The visible primes are highlighted in yellow while the hidden primes are highlighted in red. The central 1 square is white while the nonprimes are gray. Zoom into the image to see the grid point numbers.
- Eric Weisstein's World of Mathematics, Visible Point.
- Wikipedia, Ulam Spiral.
Crossrefs
Programs
-
Maple
x:= 0: y:= 0: R:= NULL: count:= 0: for i from 2 while count < 100 do if x >= y then if x < -y + 1 then x:= x+1 elif x > y then y:= y+1 else x:= x-1 fi elif x <= -y then y:= y-1 else x:= x-1 fi; if isprime(i) and igcd(abs(x),abs(y))=1 then R:= R,i; count:= count+1 fi od: R; # Robert Israel, Feb 16 2024
Comments