OFFSET
1,1
EXAMPLE
2*3*5*7-11=199 prime 2*3*5*7+11=221=13*17 composite
2*2*3*5*7-11=409 prime 2*2*3*5*7+11=431 prime
2*P(4)#-P(5) and 2*P(4)+P(5) both primes, so k=2 for n=4.
MATHEMATICA
Primorial[n_] := Product[ Prime[i], {i, n}]; f[n_] := Block[{k = 1, p = Primorial[n], q = Prime[n + 1]}, While[k*p - q < 2 || !PrimeQ[k*p - q] || !PrimeQ[k*p + q], k++ ]; k]; Table[ f[n], {n, 63}] (* Robert G. Wilson v, Aug 31 2004 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Pierre CAMI, Aug 27 2004
EXTENSIONS
More terms from Robert G. Wilson v, Aug 31 2004
STATUS
approved