login
A364920
a(n) is the least prime p > prime(n) such that p * prime(n)# + 1 is prime, where q# denotes the product of all primes <= q.
0
3, 5, 7, 11, 19, 29, 29, 31, 31, 31, 61, 59, 71, 53, 61, 149, 109, 101, 197, 113, 113, 139, 179, 131, 233, 127, 137, 113, 191, 223, 191, 151, 241, 311, 167, 199, 167, 191, 401, 227, 277, 197, 257, 263, 233, 277, 389, 251, 263, 373, 499, 503, 311, 487, 433, 283
OFFSET
1,1
FORMULA
Limit_{N->oo} (Sum_{n=1..N} a(n)) / (Sum_{n=1..N} prime(n)) = 3/2.
MATHEMATICA
a[n_] := Module[{p = Prime[n + 1], pr = Product[Prime[i], {i, 1, n}]}, While[! PrimeQ[p*pr + 1], p = NextPrime[p]]; p]; Array[a, 100] (* Amiram Eldar, Aug 12 2023 *)
PROG
(PARI) a(n) = my(p=nextprime(prime(n)+1), P=vecprod(primes(n))); while (!ispseudoprime(p*P+1), p=nextprime(p+1)); p; \\ Michel Marcus, Aug 13 2023
CROSSREFS
Cf. A002110.
Sequence in context: A161420 A071997 A093442 * A155008 A367195 A175196
KEYWORD
nonn
AUTHOR
Alain Rocchelli, Aug 12 2023
STATUS
approved