This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A115258 #28 Aug 16 2025 06:19:28 %S A115258 83,101,127,137,163,199,233,311,373,443,463,491,541,587,613,631,641, %T A115258 659,673,683,691,733,757,797,859,881,911,919,953,971,991,1013,1051, %U A115258 1061,1103,1109,1117,1193,1201,1213,1249,1307,1319,1409,1433,1459,1483,1487 %N A115258 Isolated primes in Ulam's lattice (1, 2, ... in spiral). %C A115258 Isolated prime numbers have no adjacent primes in a lattice generated by writing consecutive integers starting from 1 in a spiral distribution. If n0 is the number of isolated primes and p the number of primes less than N, the ratio n0/p approaches 1 as N increases. If n1, n2, n3, n4 denote the number of primes with respectively 1, 2, 3, 4 adjacent primes in the lattice, the ratios n1/n0, n2/n1, n3/n2, n4/n3 approach 0 as N increases. The limits stand for any 2D lattice of integers generated by a priori criteria (i.e., not knowing distributions of primes) as Ulam's lattice. %D A115258 G. Balzarotti and P. P. Lava, Le sequenze di numeri interi, Hoepli, 2008, p. 22. %H A115258 Michael De Vlieger, <a href="/A115258/b115258.txt">Table of n, a(n) for n = 1..10000</a> %H A115258 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PrimeSpiral.html">Prime Spiral</a>. %e A115258 83 is an isolated prime as the adjacent numbers in lattice 50, 51, 81, 82, 84, 123, 124, 125 are not primes. %e A115258 From _Michael De Vlieger_, Dec 22 2015: (Start) %e A115258 Spiral including n <= 17^2 showing only primes, with the isolated primes in parentheses (redrawn by _Jon E. Schoenfield_, Aug 06 2017): %e A115258 257 . . . . . 251 . . . . . . . . . 241 %e A115258 . 197 . . . 193 . 191 . . . . . . . . . %e A115258 . . . . . . . . 139 .(137). . . . . 239 %e A115258 .(199).(101). . . 97 . . . . . . . 181 . %e A115258 . . . . . . . . 61 . 59 . . . 131 . . %e A115258 . . . 103 . 37 . . . . . 31 . 89 . 179 . %e A115258 263 . 149 . 67 . 17 . . . 13 . . . . . . %e A115258 . . . . . . . 5 . 3 . 29 . . . . . %e A115258 . . 151 . . . 19 . . 2 11 . 53 .(127).(233) %e A115258 . . . 107 . 41 . 7 . . . . . . . . . %e A115258 . . . . 71 . . . 23 . . . . . . . . %e A115258 . . . 109 . 43 . . . 47 . . .(83) . 173 . %e A115258 269 . . . 73 . . . . . 79 . . . . . 229 %e A115258 . . . . . 113 . . . . . . . . . . . %e A115258 271 . 157 . . . . .(163). . . 167 . . . 227 %e A115258 . 211 . . . . . . . . . . . 223 . . . %e A115258 . . . . 277 . . . 281 . 283 . . . . . . %e A115258 (End) %p A115258 # A is Ulam's lattice %p A115258 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; %t A115258 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 *) %Y A115258 Cf. A001107, A002939, A007742, A033951-A033954, A033989, A033990, A033991, A002943, A033996, A033988, A014848. %Y A115258 Cf. A113688 (isolated semiprimes in the semiprime spiral), A156859. %K A115258 nonn %O A115258 1,1 %A A115258 _Giorgio Balzarotti_ and _Paolo P. Lava_, Feb 17 2006