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”).

A118377
a(n) is the least prime p such that prime(n)# * p# - 1 is prime.
0
2, 2, 2, 2, 3, 3, 2, 2, 13, 3, 13, 2, 3, 11, 7, 37, 151, 11, 113, 2, 5, 2, 401, 73, 7, 109, 3, 7, 101, 2, 11, 109, 5, 277, 11, 7, 31, 89, 191, 31, 11, 2713, 11, 13, 73, 461, 17, 17, 5, 41, 257, 17, 127, 1307, 53, 71, 281, 829, 139, 269, 137, 7, 41, 19, 107, 89
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
Cf. A002110.
Sequence in context: A366800 A366799 A322168 * A023516 A156607 A093450
KEYWORD
nonn
AUTHOR
Pierre CAMI, May 15 2006
EXTENSIONS
More terms from Amiram Eldar, Sep 11 2021
STATUS
approved