cp's OEIS Frontend

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.

A353088 Primes having square prime gaps to both neighbor primes.

This page as a plain text file.
%I A353088 #31 Jan 22 2024 18:56:08
%S A353088 9551,12889,22193,22307,27143,29917,32261,40423,42863,46807,46993,
%T A353088 47981,57637,60041,60493,71597,72613,73819,77137,84263,88427,89153,
%U A353088 90583,93463,97463,97613,97883,112543,115057,118931,126307,127877,131321,134093,137873,144883
%N A353088 Primes having square prime gaps to both neighbor primes.
%H A353088 Alois P. Heinz, <a href="/A353088/b353088.txt">Table of n, a(n) for n = 1..10000</a>
%e A353088 Prime 9551 is a term, the gap to the previous prime 9547 is 4 and the gap to the next prime 9587 is 36 and both gaps are squares.
%p A353088 q:= n-> isprime(n) and andmap(issqr, [n-prevprime(n), nextprime(n)-n]):
%p A353088 select(q, [$3..200000])[];
%t A353088 q[n_] := PrimeQ[n] && IntegerQ@Sqrt[n-NextPrime[n, -1]] && IntegerQ@ Sqrt[NextPrime[n]-n];
%t A353088 Select[Range[3, 200000], q] (* _Jean-François Alcover_, May 14 2022, after _Alois P. Heinz_ *)
%t A353088 Select[Prime[Range[2,15000]],AllTrue[{Sqrt[#-NextPrime[#,-1]],Sqrt[NextPrime[#]-#]},IntegerQ]&] (* _Harvey P. Dale_, Jan 22 2024 *)
%o A353088 (Python)
%o A353088 from itertools import islice
%o A353088 from sympy import nextprime, integer_nthroot
%o A353088 def A353088_gen(): # generator of terms
%o A353088     p, q, g, h = 3, 5, True, False
%o A353088     while True:
%o A353088         if g and h:
%o A353088             yield p
%o A353088         p, q = q, nextprime(q)
%o A353088         g, h = h, integer_nthroot(q-p,2)[1]
%o A353088 A353088_list = list(islice(A353088_gen(),30)) # _Chai Wah Wu_, Apr 22 2022
%Y A353088 Intersection of A000040 and A353073.
%Y A353088 Cf. A000290, A001223, A016742, A138198, A353135, A353136, A353137, A353550.
%K A353088 nonn
%O A353088 1,1
%A A353088 _Alois P. Heinz_, Apr 22 2022