OFFSET
1,1
EXAMPLE
2*2-1 = 3 is prime, 2 = p(1)#, so a(1) = 2.
2*3*2-1 = 11 is prime, 2*3 = p(2)#, so a(2) = 2.
2*3*5*2-1 = 59 is prime, 2*3*5 = p(3)#, so a(3) = 2.
2*3*5*7*2-1 = 419 is prime, 2*3*5*7 = p(4)#, so a(4) = 2.
2*3*5*7*11*2*3-1 = 13859 is prime, 2*3*5*7*11 = p(5)#, so a(5) = 3.
MATHEMATICA
pr[n_] := Product[Prime[i], {i, 1, n}]; a[n_] := Module[{prn = pr[n], k = 1}, While[!PrimeQ[prn*pr[k] - 1], k++]; Prime[k]]; Array[a, 50] (* Amiram Eldar, Sep 11 2021 *)
PROG
(PARI) pr(p) = my(pr=1); forprime(q=2, p, pr *= q); pr;
a(n) = my(p=2, P=pr(prime(n))); while (!ispseudoprime(P*pr(p)-1), p = nextprime(p+1)); p; \\ Michel Marcus, Sep 11 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, May 15 2006
EXTENSIONS
More terms from Amiram Eldar, Sep 11 2021
STATUS
approved