login
A153119
Primes p such that p^2 +- 30 are also primes.
8
7, 13, 47, 79, 113, 251, 317, 397, 547, 719, 1013, 1153, 2113, 2141, 2179, 2267, 2309, 2749, 3271, 3557, 3631, 3739, 4243, 4783, 4919, 5399, 5563, 5881, 5927, 6389, 6701, 7229, 7351, 7547, 7691, 7741, 7817, 8191, 8269, 8779, 8807, 9067, 9133, 9277, 10067
OFFSET
1,1
LINKS
MATHEMATICA
fQ[n_]:=PrimeQ[n^2-30]&&PrimeQ[n^2+30]; lst={}; Do[If[fQ@Prime[n], AppendTo[lst, Prime[n]]], {n, 7!}]; lst
Select[Prime[Range[2000]], PrimeQ[#^2 + 30] && PrimeQ[#^2 -30]&] (* Vincenzo Librandi, Apr 08 2013 *)
Select[Prime[Range[1500]], AllTrue[#^2+{30, -30}, PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Sep 13 2019 *)
PROG
(Magma) [p: p in PrimesUpTo(11000) | IsPrime(p^2+30) and IsPrime(p^2-30)]; // Vincenzo Librandi, Apr 08 2013
CROSSREFS
Cf. A153116.
Sequence in context: A374727 A219501 A267310 * A166703 A116522 A320462
KEYWORD
nonn,easy
AUTHOR
STATUS
approved