OFFSET
1,1
EXAMPLE
13*2 - 3 = 23, 13*2 + 3 = 29, 23 and 29 are consecutive primes, so a(1) = 13.
4*2*3*5 - 7 = 113, 4*2*3*5 + 7 = 127, 113 and 127 are consecutive primes, so a(3) = 4.
MATHEMATICA
a[n_] := Module[{k = 1, p = Product[Prime[i], {i, 1, n}], p1 = Prime[n+1]}, While[!PrimeQ[k*p - p1] || NextPrime[k*p - p1] != k*p + p1, k++]; k]; Array[a, 60] (* Amiram Eldar, Aug 28 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jul 26 2006
EXTENSIONS
More terms from Amiram Eldar, Aug 28 2021
STATUS
approved