login
A147791
Primes p such that p^q-2 is prime for some prime q.
0
2, 3, 5, 7, 13, 19, 29, 31, 37, 43, 47, 61, 67, 71, 89, 103, 107, 109, 127, 131, 139, 151, 163, 173, 181, 191, 199, 211, 223, 229, 233, 239, 241, 257, 271, 277, 283, 293, 313, 337, 349, 359, 367, 379, 421, 433, 439, 443, 449, 457, 467, 491, 523, 541, 547, 569
OFFSET
1,1
COMMENTS
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.
EXAMPLE
2^2-2 = 2 is prime, so a(1)=2.
3^2-2 = 7 is prime, so a(2)=3.
For q=2,3,5, 199^q-2 is not prime. For q=7, 199^7-2 is prime, so a(27)=199.
PROG
(PARI) g2(n) = forprime(x=2, n, y=g(1000, x); if(y>0, print1(x", ")))
g(n, m) = p1=0; forprime(p=2, n, y=m^p-2; if(ispseudoprime(y), p1=p; break)); p1
CROSSREFS
Sequence in context: A062252 A153800 A362777 * A169647 A072467 A062326
KEYWORD
nonn
AUTHOR
Cino Hilliard, Nov 13 2008
EXTENSIONS
Offset corrected by Mohammed Yaseen, Jul 20 2023
STATUS
approved