OFFSET
2,3
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 2..1000
FORMULA
a(n)=1 for n=2, 3, 5, 6, 13, 24, 66, 68, 167, ... (A057704); a(n)=A055211(n) otherwise. - Jeppe Stig Nielsen, Oct 31 2003
EXAMPLE
Before 7th primorial 510481 is the largest prime. Its distance from 510510 is a(7)=29.
MAPLE
[seq(product(ithprime(j), j=1..n)-prevprime(product(ithprime(j), j=1..n)), n=2..50)];
MATHEMATICA
Map[# - NextPrime[#, -1] &, Rest@ FoldList[Times, Prime@ Range[59]]] (* Michael De Vlieger, Aug 10 2023 *)
PROG
(PARI) a(n) = my(P=vecprod(primes(n))); P-precprime(P-1); \\ Michel Marcus, Aug 11 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Mar 23 2001
EXTENSIONS
More terms from Jeppe Stig Nielsen, Oct 31 2003
STATUS
approved