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.

A065377 Primes not of the form p + k^2, with p prime and k > 0.

Original entry on oeis.org

2, 5, 13, 31, 37, 61, 127, 379, 439, 571, 829, 991, 1549, 3319, 7549
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 03 2001

Keywords

Comments

Probably finite and 7549 is the last entry. - Robert G. Wilson v, Nov 05 2001
No more terms below 10^9. - Mauro Fiorentini, Mar 02 2020

Crossrefs

Cf. A000040. Complement of A065376.

Programs

  • Maple
    N:= 10^6: # to get all entries <= N
    Primes:= select(isprime,{2,seq(2*i+1,i=1..floor((N-1)/2))}):
    A:= NULL:
    for i from 1 to nops(Primes) do
    for k from floor(sqrt(Primes[i])) to 1 by -1 do
       if isprime(Primes[i] - k^2) then break fi
    od:
    if k = 0 then A:= A, Primes[i] fi;
    od:
    A; # Robert Israel, Sep 03 2014
  • Mathematica
    Do[ k = 1; p = Prime[n]; While[k^2 < p && !PrimeQ[p - k^2], k++ ]; If[k^2 > p, Print[p]], {n, 1, 10^6} ]
    Module[{nn=1000,pr},pr=Flatten[Table[Prime[n]+Range[nn]^2,{n,nn}]];Complement[Prime[Range[nn]],pr]] (* Harvey P. Dale, May 30 2014 *)
  • PARI
    is(p)=forstep(m=2,sqrtint(p),2,if(isprime(p-m^2),return(0)));isprime(p) && (p==2 || !issquare(p-2)) \\ Charles R Greathouse IV, Jun 04 2012

Extensions

Offset corrected by Charles R Greathouse IV, May 29 2012