%I #21 May 14 2023 16:14:15
%S 2,3,5,7,17,19,37,71,79,113,857,863,16361,62989
%N Primes p such that 2*p#-1 is prime.
%e 2*2 - 1 = 3, 3 prime so a(1)=2;
%e 2*2*3 - 1 = 11, 11 prime so a(2)=3;
%e 2*2*3*5 - 1 = 59, 59 prime so a(3)=5.
%t Module[{nn=900,pr,pl},pr=Prime[Range[nn]];pl=FoldList[Times,pr];Select[ Thread[{pr,pl}],PrimeQ[2*#[[2]]-1]&][[All,1]]] (* _Harvey P. Dale_, May 02 2018 *)
%o (Magma) [p:p in PrimesUpTo(4000)|IsPrime(2*&*PrimesUpTo(p)-1)]; // _Marius A. Burtea_, Mar 25 2019
%o (Python)
%o from sympy import isprime, nextprime
%o def afind(limit):
%o p = 2
%o twoprimorialp = 4
%o while p <= limit:
%o if isprime(twoprimorialp - 1):
%o print(p, end=", ")
%o p = nextprime(p)
%o twoprimorialp *= p
%o afind(1000) # _Michael S. Branicky_, Jan 08 2022
%Y Cf. A119834, A119835.
%K nonn,more
%O 1,1
%A _Pierre CAMI_, May 25 2006
%E a(13) from _Michael S. Branicky_, Jan 08 2022
%E a(14) from _Michael S. Branicky_, May 14 2023
|