OFFSET
1,1
COMMENTS
At p = 2, 3, 139, 3^p + 2 is prime, while at p = 2, 5, 37, 41, 317, 541, 2521 3^p - 2 is prime.
a(10) > 2*10^5. - Robert Price, Nov 20 2013
EXAMPLE
2 is in the sequence because both 3^2 - 2 = 7 and 3^2 + 2 = 11 are primes.
3 is in the sequence because 3^3 + 2 = 29 is a prime (though 3^3 - 2 = 25 = 5^2).
5 is in the sequence because 3^5 - 2 = 241 is a prime (though 3^5 + 2 = 245 = 5 * 7^2).
MATHEMATICA
Select[Prime[Range[100]], PrimeQ[3^# - 2] || PrimeQ[3^# + 2] &] (* Alonso del Arte, Nov 20 2013 *)
CROSSREFS
KEYWORD
nonn,more,hard
AUTHOR
Herman H. Rosenfeld (herm3(AT)pacbell.net), Dec 20 2003
EXTENSIONS
Edited by Zak Seidov, Aug 08 2006
STATUS
approved