A238739 Numbers n such that 2^n + 3 and 3*2^n + 1 are both prime.
1, 2, 6, 12, 18, 30
Offset: 1
Examples
a(1) = 1 because 2^1 + 3 = 5 and 3*2^1 + 1 = 7 are both prime, a(2) = 2 because 2^2 + 3 = 7 and 3^2^2 + 1 = 13 are both prime, a(3) = 6 because 2^6 + 3 = 67 and 3*2^6 + 1 = 193 are both prime.
Programs
-
Magma
[n: n in [0..30] | IsPrime(2^n+3) and IsPrime(3*2^n+1)]; // Arkadiusz Wesolowski, Jan 23 2016
-
Mathematica
Select[Range[30],AllTrue[{2^#+3,3*2^#+1},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Aug 08 2015 *)
-
PARI
isok(n) = isprime(2^n + 3) && isprime(3*2^n + 1); \\ Michel Marcus, Mar 04 2014
Comments