login
Primes p such that either 3^p-2 or 3^p+2 is prime.
0

%I #16 Aug 25 2024 17:34:55

%S 2,3,5,37,41,139,317,541,2521

%N Primes p such that either 3^p-2 or 3^p+2 is prime.

%C 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.

%C a(10) > 2*10^5. - _Robert Price_, Nov 20 2013

%e 2 is in the sequence because both 3^2 - 2 = 7 and 3^2 + 2 = 11 are primes.

%e 3 is in the sequence because 3^3 + 2 = 29 is a prime (though 3^3 - 2 = 25 = 5^2).

%e 5 is in the sequence because 3^5 - 2 = 241 is a prime (though 3^5 + 2 = 245 = 5 * 7^2).

%t Select[Prime[Range[100]], PrimeQ[3^# - 2] || PrimeQ[3^# + 2] &] (* _Alonso del Arte_, Nov 20 2013 *)

%Y Cf. A014224, A051783.

%K nonn,more,hard

%O 1,1

%A Herman H. Rosenfeld (herm3(AT)pacbell.net), Dec 20 2003

%E Edited by _Zak Seidov_, Aug 08 2006