login
Primes p such that p*(3^p) + 2 is also prime.
0

%I #36 Oct 08 2024 17:27:42

%S 3,5,11,17,317,373,10313

%N Primes p such that p*(3^p) + 2 is also prime.

%C The terms of this sequence are the prime terms of A265121.

%C The first few corresponding primes are 83, 1217, 1948619, 2195382773, ... .

%C a(8) > 10^5. - _Michael S. Branicky_, Oct 08 2024

%e p = 17; [17 * (3 ^ 17) + 2] = 2195382773 (is a prime number).

%p select(p -> isprime(p) and isprime(p*3^p+2), [seq(i,i=3..2000,2)]); # _Robert Israel_, Jan 10 2016

%t Select[Prime@ Range@ 1000, PrimeQ[# (3^#) + 2] &] (* _Michael De Vlieger_, Jan 09 2016 *)

%o (Magma) [p: p in PrimesUpTo(1000) | IsPrime((p*(3^p)+2))]; // _Vincenzo Librandi_, Jan 10 2016

%o (PARI) lista(nn) = forprime(p=2, nn, if(ispseudoprime((p*(3^p) + 2)), print1(p, ", "))); \\ _Altug Alkan_, Jan 10 2016

%Y Cf. A265121.

%K nonn,more

%O 1,1

%A _Emre APARI_, Jan 09 2016