A115258 Isolated primes in Ulam's lattice (1, 2, ... in spiral).
83, 101, 127, 137, 163, 199, 233, 311, 373, 443, 463, 491, 541, 587, 613, 631, 641, 659, 673, 683, 691, 733, 757, 797, 859, 881, 911, 919, 953, 971, 991, 1013, 1051, 1061, 1103, 1109, 1117, 1193, 1201, 1213, 1249, 1307, 1319, 1409, 1433, 1459, 1483, 1487
Offset: 1
Keywords
Examples
83 is an isolated prime as the adjacent numbers in lattice 50, 51, 81, 82, 84, 123, 124, 125 are not primes. From _Michael De Vlieger_, Dec 22 2015: (Start) Spiral including n <= 17^2 showing only primes, with the isolated primes in parentheses (redrawn by _Jon E. Schoenfield_, Aug 06 2017): 257 . . . . . 251 . . . . . . . . . 241 . 197 . . . 193 . 191 . . . . . . . . . . . . . . . . . 139 .(137). . . . . 239 .(199).(101). . . 97 . . . . . . . 181 . . . . . . . . . 61 . 59 . . . 131 . . . . . 103 . 37 . . . . . 31 . 89 . 179 . 263 . 149 . 67 . 17 . . . 13 . . . . . . . . . . . . . 5 . 3 . 29 . . . . . . . 151 . . . 19 . . 2 11 . 53 .(127).(233) . . . 107 . 41 . 7 . . . . . . . . . . . . . 71 . . . 23 . . . . . . . . . . . 109 . 43 . . . 47 . . .(83) . 173 . 269 . . . 73 . . . . . 79 . . . . . 229 . . . . . 113 . . . . . . . . . . . 271 . 157 . . . . .(163). . . 167 . . . 227 . 211 . . . . . . . . . . . 223 . . . . . . . 277 . . . 281 . 283 . . . . . . (End)
References
- G. Balzarotti and P. P. Lava, Le sequenze di numeri interi, Hoepli, 2008, p. 22.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Prime Spiral.
Crossrefs
Programs
-
Maple
# A is Ulam's lattice if (isprime(A[x,y])and(not(isprime(A[x+1,y]) or isprime(A[x-1,y])or isprime(A[x,y+1])or isprime(A[x,y-1])or isprime(A[x-1,y-1])or isprime(A[x+1,y+1])or isprime(A[x+1,y-1])or isprime(A[x-1,y+1])))) then print (A[x,y]) ; fi;
-
Mathematica
spiral[n_] := Block[{o = 2 n - 1, t, w}, t = Table[0, {o}, {o}]; t = ReplacePart[t, {n, n} -> 1]; Do[w = Partition[Range[(2 (# - 1) - 1)^2 + 1, (2 # - 1)^2], 2 (# - 1)] &@ k; Do[t = ReplacePart[t, {(n + k) - (j + 1), n + (k - 1)} -> #[[1, j]]]; t = ReplacePart[t, {n - (k - 1), (n + k) - (j + 1)} -> #[[2, j]]]; t = ReplacePart[t, {(n - k) + (j + 1), n - (k - 1)} -> #[[3, j]]]; t = ReplacePart[t, {n + (k - 1), (n - k) + (j + 1)} -> #[[4, j]]], {j, 2 (k - 1)}] &@ w, {k, 2, n}]; t]; f[w_] := Block[{d = Dimensions@ w, t, g}, t = Reap[Do[Sow@ Take[#[[k]], {2, First@ d - 1}], {k, 2, Last@ d - 1}]][[-1, 1]] &@ w; g[n_] := If[n != 0, Total@ Join[Take[w[[Last@ # - 1]], {First@ # - 1, First@ # + 1}], {First@ #, Last@ #} &@ Take[w[[Last@ #]], {First@ # - 1, First@ # + 1}], Take[w[[Last@ # + 1]], {First@ # - 1, First@# + 1}]] &@(Reverse@ First@ Position[t, n] + {1, 1}) == 0, False]; Select[Union@ Flatten@ t, g@ # &]]; f[spiral@ 21 /. n_ /; CompositeQ@ n -> 0] (* Michael De Vlieger, Dec 22 2015, Version 10 *)
Comments