OFFSET
0,1
LINKS
Robert Israel, Table of n, a(n) for n = 0..201
EXAMPLE
a(6) = 2*(5*7*11*13*17*19)+1 = 3233231 because that is prime while 2*(2*3*5*7*11*13)+1 = 60061 and 2*(3*5*7*11*13*17)+1 = 510511 are not prime.
MAPLE
f:= proc(n) local P, i, r;
P:= mul(ithprime(i), i=1..n);
for i from 1 do
r:= 2*P+1;
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, 1, n}], p1 = 2, p2 = Prime[n + 1]}, While[! PrimeQ[2*x + 1], x *= (p2/p1); p1 = NextPrime[p1]; p2 = NextPrime[p2]]; 2*x + 1]; Array[a, 17, 0] (* Amiram Eldar, Jan 25 2022 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Jan 25 2022
STATUS
approved