%I #13 Jul 21 2023 21:02:54
%S 2,3,5,7,13,19,29,31,37,43,47,61,67,71,89,103,107,109,127,131,139,151,
%T 163,173,181,191,199,211,223,229,233,239,241,257,271,277,283,293,313,
%U 337,349,359,367,379,421,433,439,443,449,457,467,491,523,541,547,569
%N Primes p such that p^q-2 is prime for some prime q.
%C For p>3, p^2-1 is divisible by 6. This follows from the fact that primes p>3 are of the form 6n+1 or 6n-1 and in either case p^2-1 is divisible by 6.
%e 2^2-2 = 2 is prime, so a(1)=2.
%e 3^2-2 = 7 is prime, so a(2)=3.
%e For q=2,3,5, 199^q-2 is not prime. For q=7, 199^7-2 is prime, so a(27)=199.
%o (PARI) g2(n) = forprime(x=2,n,y=g(1000,x);if(y>0,print1(x",")))
%o g(n, m) = p1=0;forprime(p=2,n,y=m^p-2;if(ispseudoprime(y),p1=p;break));p1
%K nonn
%O 1,1
%A _Cino Hilliard_, Nov 13 2008
%E Offset corrected by _Mohammed Yaseen_, Jul 20 2023
|