%I #35 Oct 13 2024 19:37:35
%S 23,37,43,73,107,109,113,137,157,179,211,223,227,229,239,251,257,271,
%T 277,283,311,313,317,347,353,367,389,439,443,467,503,509,521,523,547,
%U 557,563,577,587,593,601,631,653,661,719,733,757,797,811,821,823,829,853,859,877,883
%N Primes p such that p^2 +/- p +/- 1 are all nonprimes.
%H Harvey P. Dale, <a href="/A290767/b290767.txt">Table of n, a(n) for n = 1..1000</a>
%F Intersection of the complements of A053184, A053182, A065508, and A091567 within the primes A000040.
%p 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
%t Select[Prime[Range[1000]], ! (PrimeQ[#^2 + # + 1] || PrimeQ[#^2 + # - 1] ||PrimeQ[#^2 - # + 1] || PrimeQ[#^2 - # - 1]) &]
%t Select[Prime[Range[200]],NoneTrue[{#^2+#+1,#^2+#-1,#^2-#+1,#^2-#-1},PrimeQ]&] (* _Harvey P. Dale_, Oct 13 2024 *)
%o (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
%o forprime(p=1, 900, if(is(p), print1(p, ", "))) \\ _Felix Fröhlich_, Aug 10 2017
%Y Cf. A000040, A053184, A053182, A065508, A091567, A236056.
%K nonn,changed
%O 1,1
%A _Ralf Steiner_, Aug 10 2017