%I #2 Oct 01 2013 18:07:49
%S 2,2,2,2,2,2,2,3,2,2,2,2,3,2,2,2,2,3,2,2,2,3,149,2,5,2,7,2,2,5,2,2,3,
%T 2,5,3,89,2,2,2,13,2,3,367,2,17,3,2,2,3,2,2,2,2,439,2,61,127,2,2,3,2,
%U 37,2,3,2,2,2,2,2,2,2
%N Smallest prime q such that p^q-2 is prime where p ranges over the set of primes numbers.
%e 2^2-2 = 2 prime so a(1)=2, 3^2-2= 7 prime a(2)=2. For q=2,3,5, 199^q-2 is not
%e prime. For q=7, 199^7-2 = 12358664279161397 prime so a(27)=7.
%o (PARI) g2(n) = forprime(x=2,n,y=g(1000,x);if(y>0,print1(y",")))
%o g(n, m) = p1=0;forprime(p=2,n,y=m^p-2;if(ispseudoprime(y),p1=p;break));p1
%K nonn
%O 2,1
%A _Cino Hilliard_, Nov 13 2008