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 A353072 #21 May 05 2023 20:25:29 %S A353072 1,2,4,6,7,10,12,13,16,18,19,22,25,28,30,33,36,37,40,42,43,46,49,52, %T A353072 55,58,60,63,66,67,70,72,75,78,79,82,85,88,93,96,97,100,102,103,106, %U A353072 108,109,112,118,123,126,127,130,133,136,138,140,145,148,150,153 %N A353072 Numbers k such that nextprime(k)-k is a positive square. %C A353072 Numbers p-1, where p is prime is a subsequence (see A006093). %H A353072 David A. Corneth, <a href="/A353072/b353072.txt">Table of n, a(n) for n = 1..10000</a> %e A353072 The next prime after 7 is 11, and 11-7 = 4 a square, so 7 is in this sequence. %e A353072 The next prime after 118 is 127, 127-118 = 9 is a square, so 118 is a term. %t A353072 Select[Range[2000], NextPrime[#] - # > 0 && IntegerQ[Sqrt[NextPrime[#] - #]] &] %t A353072 npsQ[n_]:=With[{c=NextPrime[n]-n},c>0&&IntegerQ[Sqrt[c]]]; Select[Range[200],npsQ] (* _Harvey P. Dale_, May 05 2023 *) %o A353072 (PARI) upto(n) = {my(res = List(1), q = 2, u = nextprime(n + 1)); forprime(p = 3, u, forstep(i = sqrtint(p - q), 1, -1, listput(res, p-i^2) ); q = p ); res } \\ _David A. Corneth_, Apr 22 2022 %o A353072 (PARI) isok(k) = issquare(nextprime(k+1)-k); \\ _Michel Marcus_, Apr 22 2022 %Y A353072 Cf. A006093, A013632, A029710. %K A353072 nonn %O A353072 1,2 %A A353072 _Tanya Khovanova_, Apr 21 2022