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
KEYWORD
nonn
AUTHOR
Cino Hilliard, Nov 13 2008
EXTENSIONS
Offset corrected by Mohammed Yaseen, Jul 20 2023
STATUS
approved