OFFSET
1,1
LINKS
EXAMPLE
2*(2*3*5*7) - 1 = 419;
2*(2*3*5*7) + 1 = 421;
419 and 421 are twin primes, 2*3*5*7 = p(4)#, so a(4)=2.
PROG
(PARI) P(n) = prod(i=1, n, prime(i)); \\ A002110
a(n) = my(P=P(n), q=2); while(!ispseudoprime(P*q-1) || !ispseudoprime(P*q+1), q = nextprime(q+1)); q; \\ Michel Marcus, May 16 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Feb 19 2007
EXTENSIONS
a(11) corrected by Seth A. Troisi, May 13 2022
STATUS
approved