OFFSET
0,1
LINKS
Robert Israel, Table of n, a(n) for n = 0..222
EXAMPLE
a(4) = 17*19*23*29+2 because that is prime while 2*3*5*7+2, 3*5*7*11+2, ..., 13*17*19*23+2 are not.
MAPLE
f:= proc(n) local P, i, r;
P:= mul(ithprime(i), i=2..n+1);
for i from 2 do
r:= P+2;
if isprime(r) then return r fi;
P:= P/ithprime(i)*ithprime(i+n);
od
end proc:
map(f, [$0..20]);
MATHEMATICA
a[n_] := Module[{x = Product[Prime[i], {i, 2, n + 1}], p1 = 3, p2 = Prime[n + 2]}, While[! PrimeQ[x + 2], x *= (p2/p1); p1 = NextPrime[p1]; p2 = NextPrime[p2]]; x + 2]; Array[a, 17, 0] (* Amiram Eldar, Jan 25 2022 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Jan 25 2022
STATUS
approved