login
Primes p such that 2*p#-1 and 2*p#+1 are twin primes.
2

%I #17 Nov 01 2024 19:43:15

%S 2,3,5,7,113,857

%N Primes p such that 2*p#-1 and 2*p#+1 are twin primes.

%e 2*2-1=3 2*2+1=5, 3 and 5 twin primes so a(1)=2;

%e 2*2*3-1=11 2*2*3+1=13, 11 and 13 twin primes so a(2)=3;

%e 2*2*3*5-1=59 2*2*3*5+1=61, 59 and 61 twin primes so a(3)=5.

%p isA001359 := proc(n) RETURN(isprime(n) and isprime(n+2)); end: primo := 2 : print(primo); for n from 2 to 20000 do p := ithprime(n); primo := primo*p; if isA001359(2*primo-1) then print(p); fi; od : # _R. J. Mathar_, Aug 09 2006

%o (Magma) [p:p in PrimesUpTo(4000)|IsPrime(2*&*PrimesUpTo(p)-1) and IsPrime(2*&*PrimesUpTo(p)+1)]; // _Marius A. Burtea_, Mar 25 2019

%Y Cf. A119833, A119834.

%K more,nonn,changed

%O 1,1

%A _Pierre CAMI_, May 25 2006