Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #11 Sep 08 2022 08:45:39
%S 7,13,47,79,113,251,317,397,547,719,1013,1153,2113,2141,2179,2267,
%T 2309,2749,3271,3557,3631,3739,4243,4783,4919,5399,5563,5881,5927,
%U 6389,6701,7229,7351,7547,7691,7741,7817,8191,8269,8779,8807,9067,9133,9277,10067
%N Primes p such that p^2 +- 30 are also primes.
%H Vincenzo Librandi, <a href="/A153119/b153119.txt">Table of n, a(n) for n = 1..1000</a>
%t fQ[n_]:=PrimeQ[n^2-30]&&PrimeQ[n^2+30]; lst={}; Do[If[fQ@Prime[n],AppendTo[lst,Prime[n]]],{n,7!}]; lst
%t Select[Prime[Range[2000]], PrimeQ[#^2 + 30] && PrimeQ[#^2 -30]&] (* _Vincenzo Librandi_, Apr 08 2013 *)
%t 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 *)
%o (Magma) [p: p in PrimesUpTo(11000) | IsPrime(p^2+30) and IsPrime(p^2-30)]; // _Vincenzo Librandi_, Apr 08 2013
%Y Cf. A153116.
%K nonn,easy
%O 1,1
%A _Vladimir Joseph Stephan Orlovsky_, Dec 18 2008