login
Primes of the form 3^k - 2^k.
9

%I #27 Sep 08 2022 08:45:02

%S 5,19,211,129009091,68629840493971,617671248800299,

%T 19383245658672820642055731,14130386091162273752461387579,

%U 1546132562196033990574082188840405015112916155251

%N Primes of the form 3^k - 2^k.

%H Vincenzo Librandi, <a href="/A058765/b058765.txt">Table of n, a(n) for n = 1..12</a>

%F a(n) = A001047(A057468(n)).

%p select(isprime, [seq(3^n - 2^n, n=0..200)]); # _Muniru A Asiru_, Mar 04 2018

%t Select[Table[3^n-2^n, {n,0,2200}], PrimeQ] (* _Vincenzo Librandi_, Dec 08 2011 *)

%o (Magma) [a: n in [0..300] | IsPrime(a) where a is 3^n - 2^n]; // _Vincenzo Librandi_, Dec 08 2011

%o (GAP) Filtered(List([1..200],n->3^n - 2^n),IsPrime); # _Muniru A Asiru_, Mar 04 2018

%o (PARI) lista(nn) = for(k=1, nn, if(isprime(p=3^k-2^k), print1(p", "))) \\ _Altug Alkan_, Mar 04 2018

%Y Cf. A001047 (3^n-2^n) and A057468 (k such that 3^k-2^k is prime).

%K nonn

%O 1,1

%A _N. J. A. Sloane_, Jan 02 2001