login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A153121 Primes p such that p^2 +- 12 and p^2 +- 18 are also primes. 1

%I #12 Sep 08 2022 08:45:39

%S 5,7,29,41,1933,4073,43049,46439,60353,72031,150989,153929,158551,

%T 158591,190051,199247,226267,438479,545749,613451,696737,714841,

%U 734663,754627,788353,793843,825259,948457,1053191,1057699,1154159,1241827

%N Primes p such that p^2 +- 12 and p^2 +- 18 are also primes.

%H Vincenzo Librandi, <a href="/A153121/b153121.txt">Table of n, a(n) for n = 1..500</a>

%t fQ[n_] := PrimeQ[n^2 - 12] && PrimeQ[n^2 + 12] && PrimeQ[n^2 - 18] && PrimeQ[n^2 + 18]; lst={}; Do[If[fQ@Prime[n], AppendTo[lst, Prime[n]]], {n, 9!}]; lst

%t Select[Prime[Range[150000]], And@@PrimeQ/@{#^2 + 12, #^2 - 12, #^2 + 18, #^2 - 18}&] (* _Vincenzo Librandi_, Apr 09 2013 *)

%t Select[Prime[Range[150000]],AllTrue[#^2+{12,18,-12,-18},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Mar 05 2015 *)

%o (Magma) [p: p in PrimesUpTo(1250000) | IsPrime(p^2-12) and IsPrime(p^2+12) and IsPrime(p^2-18) and IsPrime(p^2+18)]; // _Vincenzo Librandi_, Apr 09 2013

%Y Cf. A153116, A153119, A153120.

%K nonn,easy

%O 1,1

%A _Vladimir Joseph Stephan Orlovsky_, Dec 18 2008

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 16:52 EDT 2024. Contains 371962 sequences. (Running on oeis4.)