OFFSET
1,1
EXAMPLE
2*2 - 1 = 3, 3 prime so a(1)=2;
2*2*3 - 1 = 11, 11 prime so a(2)=3;
2*2*3*5 - 1 = 59, 59 prime so a(3)=5.
MATHEMATICA
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 *)
PROG
(Magma) [p:p in PrimesUpTo(4000)|IsPrime(2*&*PrimesUpTo(p)-1)]; // Marius A. Burtea, Mar 25 2019
(Python)
from sympy import isprime, nextprime
def afind(limit):
p = 2
twoprimorialp = 4
while p <= limit:
if isprime(twoprimorialp - 1):
print(p, end=", ")
p = nextprime(p)
twoprimorialp *= p
afind(1000) # Michael S. Branicky, Jan 08 2022
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Pierre CAMI, May 25 2006
EXTENSIONS
a(13) from Michael S. Branicky, Jan 08 2022
a(14) from Michael S. Branicky, May 14 2023
STATUS
approved