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 A113688 #42 Feb 16 2025 08:32:59 %S A113688 65,74,249,295,309,355,422,511,545,667,669,758,926,943,979,998,1099, %T A113688 1167,1186,1322,1457,1469,1561,1585,1658,1711,1774,1779,1835,1891, %U A113688 1959,1961,1963,2021,2038,2066,2155,2186,2191,2206,2271,2329,2342 %N A113688 Isolated semiprimes in the semiprime square spiral. %C A113688 Write the integers 1, 2, 3, 4, ... in a counterclockwise square spiral. Analogous to Ulam's marking the primes in the spiral and discovering unexpectedly many connected diagonals, we construct a semiprime spiral by marking the semiprimes (A001358). Each integer has 8 adjacent integers in the spiral, horizontally, vertically and diagonally. Curious extended clumps coagulate, slightly denser towards the origin, of semiprimes connected by adjacency. This sequence lists the isolated semiprimes in the semiprime spiral, namely those semiprimes none of whose adjacent integers in the spiral are semiprimes. A113689 gives an enumeration of the number of semiprimes in clumps of size > 1 through n^2. %C A113688 The squares of twin primes occupy adjacent points along the southeast diagonal, so none are isolated. Thus the only isolated semiprimes in the spiral that are squares are the squares of "isolated primes" (A007510). The first square in this sequence is a(1473) = 66049 = 257^2. - _Jon E. Schoenfield_, Aug 12 2018 %D A113688 S. M. Ellerstein, The square spiral, J. Recreational Mathematics 29 (#3, 1998) 188; 30 (#4, 1999-2000), 246-250. %H A113688 Michael De Vlieger, <a href="/A113688/b113688.txt">Table of n, a(n) for n = 1..2000</a> %H A113688 Alois P. Heinz, <a href="/A113688/a113688.png">Plot of semiprime spiral</a>, containing all semiprimes <= 10000. Isolated semiprimes are colored red. %H A113688 M. Stein and S. M. Ulam, <a href="http://www.jstor.org/stable/2314055">An Observation on the Distribution of Primes</a>, Amer. Math. Monthly 74, 43-44, 1967. %H A113688 M. Stein and S. M. Ulam and M. B. Wells, <a href="http://www.jstor.org/stable/2312588">A Visual Display of Some Properties of the Distribution of Primes</a>, Amer. Math. Monthly 71, 516-520, 1964. %H A113688 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PrimeSpiral.html">Prime Spiral</a>. %H A113688 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Semiprime.html">Semiprime</a>. %e A113688 Spiral example: %e A113688 . %e A113688 17--16--15--14--13 %e A113688 | | %e A113688 18 5---4---3 12 %e A113688 | | | | %e A113688 19 6 1---2 11 %e A113688 | | | %e A113688 20 7---8---9--10 %e A113688 | %e A113688 21--22--23--24--25 %e A113688 . %e A113688 From _Michael De Vlieger_, Dec 22 2015: (Start) %e A113688 Spiral including n <= 121 showing only semiprimes; the isolated semiprimes appear in parentheses: %e A113688 . %e A113688 .---.---.---.---.---.--95--94--93---.--91 %e A113688 | | %e A113688 . (65)--.---.--62---.---.---.--58--57 . %e A113688 | | | | %e A113688 . . .---.--35--34--33---.---. . . %e A113688 | | | | | | %e A113688 . . 38 .---.--15--14---. . 55 . %e A113688 | | | | | | | | %e A113688 . . 39 . .---4---. . . . 87 %e A113688 | | | | | | | | | | %e A113688 106 69 . . 6 .---. . . . 86 %e A113688 | | | | | | | | | %e A113688 . . . . .---.---9--10 . . 85 %e A113688 | | | | | | | %e A113688 . . . 21--22---.---.--25--26 51 . %e A113688 | | | | | %e A113688 . . .---.---.--46---.---.--49---. . %e A113688 | | | %e A113688 . .-(74)--.---.--77---.---.---.---.--82 %e A113688 | %e A113688 111---.---.---.-115---.---.-118-119---.-121 %e A113688 . %e A113688 (End) %t A113688 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@ # &]]; t = spiral@ 26 /. n_ /; PrimeOmega@ n != 2 -> 0; f@ t (* _Michael De Vlieger_, Dec 21 2015, Version 10 *) %Y A113688 Cf. A001107, A001358, A002939, A002943, A004526, A005620, A007742, A033951-A033954, A033988, A033989-A033991, A033996, A063826. %Y A113688 Cf. A115258 (isolated primes in Ulam's lattice). %K A113688 easy,nonn %O A113688 1,1 %A A113688 _Jonathan Vos Post_, Nov 05 2005 %E A113688 Corrected and extended by _Alois P. Heinz_, Jan 02 2011