OFFSET
1,3
EXAMPLE
For prime(n=3): 5 + 2 = 7, 5 + 6 = 11, and 5 + any higher primorial will be composite, so a(3) = 2.
MATHEMATICA
nn = 120; MapIndexed[Set[P[First[#2] - 1], #1] &, FoldList[Times, 1, Prime@ Range[nn]]]; Table[q = Prime[n]; Total@ Array[Boole@ PrimeQ[q + P[# - 1]] &, n], {n, nn}] (* Michael De Vlieger, Jun 22 2025 *)
PROG
(PARI) pri(n) = vecprod(primes(n)); \\ A002110
a(n) = my(nb=0, p=prime(n)); for (k=0, n-1, if (isprime(p+pri(k)), nb++); ); nb; \\ Michel Marcus, Jun 21 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Daniel D Gibson, Jun 21 2025
EXTENSIONS
More terms from Michel Marcus, Jun 21 2025
STATUS
approved
