%I #28 Feb 16 2025 08:32:35
%S 5,11,17,29,37,41,53,59,67,71,97,101,127,149,179,191,223,227,251,257,
%T 269,307,311,331,347,419,431,541,557,563,569,587,593,599,641,727,733,
%U 739,809,821,853,929,937,967,1009,1031,1087,1151,1213,1277
%N Good primes (version 2): prime(n) such that prime(n)^2 > prime(n-i)*prime(n+i) for all 1 <= i <= n-1.
%C Selfridge conjectured, and Pomerance proved, that there are infinitely many numbers in this sequence. Pomerance asks if the sequence has density 0. - _Charles R Greathouse IV_, Apr 14 2011
%D Guy, R. K. `Good' Primes and the Prime Number Graph. A14 in Unsolved Problems in Number Theory, 2nd ed. Springer-Verlag, pp. 32-33, 1994.
%H T. D. Noe, <a href="/A028388/b028388.txt">Table of n, a(n) for n = 1..10000</a>
%H Carl Pomerance, <a href="http://www.math.dartmouth.edu/~carlp/PDF/paper19.pdf">The prime number graph</a>, Mathematics of Computation 33:145 (1979), pp. 399-408.
%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/GoodPrime.html">Good Prime</a>
%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/SelfridgesConjecture.html">Selfridge's Conjecture</a>
%t Module[{nn=300,prs},prs=Prime[Range[2nn]];qprQ[n_]:=Module[{pi= PrimePi[n]}, n^2>Max[Times@@@Thread[{Take[prs,pi-1],Reverse[Take[ prs,{pi+1,2 pi-1}]]}]]];Select[Take[prs,nn],qprQ]] (* _Harvey P. Dale_, May 13 2012 *)
%o (Magma) [NthPrime(n): n in [2..220] | forall{i: i in [1..n-1] | NthPrime(n)^2 gt NthPrime(n-i)*NthPrime(n+i)}]; // _Bruno Berselli_, Oct 23 2012
%o (PARI) is(n)=if(!isprime(n),return(0));my(p=n,q=n,n2=n^2);while(p>2, p=precprime(p-1); q=nextprime(q+1); if(n2<p*q,return(0))); n>2 \\ _Charles R Greathouse IV_, Jul 02 2013
%Y Cf. A046869.
%K nonn
%O 1,1
%A _Eric W. Weisstein_