login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Least prime, p, such that 2*p*3^n - 1 and 2*p*3^n + 1 are twin primes.
0

%I #17 Feb 23 2020 16:59:19

%S 2,11,2,5,43,29,53,311,113,109,367,859,647,11,2,619,13,1051,157,2801,

%T 3767,5,337,1721,3517,41,4013,1879,1873,13649,4637,2909,8387,6521,

%U 1453,6599,1277,4801,167,1031,11213,4129,4933,199,1427,859,9227,5581,863,11959,10453

%N Least prime, p, such that 2*p*3^n - 1 and 2*p*3^n + 1 are twin primes.

%e 2*2*3^1 - 1 = 11; 11 and 13 are twin primes so a(1)=2.

%e 2*11*3^2 - 1 = 197; 197 and 199 are twin primes so a(2)=11 as no other prime p < 11 gives twin primes.

%t Array[Block[{p = 2}, While[! AllTrue[2 p 3^# + {-1, 1}, PrimeQ], p = NextPrime@ p]; p] &, 51] (* _Michael De Vlieger_, Dec 24 2019 *)

%o (PARI) a(n) = {my(p=2); while (!isprime(2*p*3^n - 1) || !isprime(2*p*3^n + 1), p = nextprime(p+1)); p;} \\ _Michel Marcus_, Nov 25 2019

%Y Cf. A130327.

%K nonn

%O 1,1

%A _Pierre CAMI_, Nov 24 2019