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.

Original entry on oeis.org

9551, 12889, 22193, 22307, 27143, 29917, 32261, 40423, 42863, 46807, 46993, 47981, 57637, 60041, 60493, 71597, 72613, 73819, 77137, 84263, 88427, 89153, 90583, 93463, 97463, 97613, 97883, 112543, 115057, 118931, 126307, 127877, 131321, 134093, 137873, 144883
Offset: 1

Views

Author

Alois P. Heinz, Apr 22 2022

Keywords

Examples

			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.
		

Crossrefs

Programs

  • Maple
    q:= n-> isprime(n) and andmap(issqr, [n-prevprime(n), nextprime(n)-n]):
    select(q, [$3..200000])[];
  • Mathematica
    q[n_] := PrimeQ[n] && IntegerQ@Sqrt[n-NextPrime[n, -1]] && IntegerQ@ Sqrt[NextPrime[n]-n];
    Select[Range[3, 200000], q] (* Jean-François Alcover, May 14 2022, after Alois P. Heinz *)
    Select[Prime[Range[2,15000]],AllTrue[{Sqrt[#-NextPrime[#,-1]],Sqrt[NextPrime[#]-#]},IntegerQ]&] (* Harvey P. Dale, Jan 22 2024 *)
  • Python
    from itertools import islice
    from sympy import nextprime, integer_nthroot
    def A353088_gen(): # generator of terms
        p, q, g, h = 3, 5, True, False
        while True:
            if g and h:
                yield p
            p, q = q, nextprime(q)
            g, h = h, integer_nthroot(q-p,2)[1]
    A353088_list = list(islice(A353088_gen(),30)) # Chai Wah Wu, Apr 22 2022