A290767 Primes p such that p^2 +/- p +/- 1 are all nonprimes.
23, 37, 43, 73, 107, 109, 113, 137, 157, 179, 211, 223, 227, 229, 239, 251, 257, 271, 277, 283, 311, 313, 317, 347, 353, 367, 389, 439, 443, 467, 503, 509, 521, 523, 547, 557, 563, 577, 587, 593, 601, 631, 653, 661, 719, 733, 757, 797, 811, 821, 823, 829, 853, 859, 877, 883
Offset: 1
Keywords
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Programs
-
Maple
select(p -> isprime(p) and not ormap(isprime, [p^2+p+1,p^2+p-1,p^2-p+1,p^2-p-1]), [2,seq(i,i=3..1000,2)]); # Robert Israel, Aug 10 2017
-
Mathematica
Select[Prime[Range[1000]], ! (PrimeQ[#^2 + # + 1] || PrimeQ[#^2 + # - 1] ||PrimeQ[#^2 - # + 1] || PrimeQ[#^2 - # - 1]) &] Select[Prime[Range[200]],NoneTrue[{#^2+#+1,#^2+#-1,#^2-#+1,#^2-#-1},PrimeQ]&] (* Harvey P. Dale, Oct 13 2024 *)
-
PARI
is(n) = my(v=[n^2+n+1, n^2+n-1, n^2-n+1, n^2-n-1]); for(k=1, #v, if(ispseudoprime(v[k]), return(0))); 1 forprime(p=1, 900, if(is(p), print1(p, ", "))) \\ Felix Fröhlich, Aug 10 2017
Comments