OFFSET
1,2
COMMENTS
r = prime(n+1)^2 is the smallest possible composite number that, if added to the n-th primorial, might give a prime.
EXAMPLE
a(5)=6, 6th primorial is 30030, square of 7th prime is 289, sum gives 30319, a prime.
MATHEMATICA
Block[{a = {}, p = 1, q = 1}, Do[q = NextPrime[q]; If[PrimeQ[p + q^2], AppendTo[a, i]]; p *= q, {i, 1200}]; Rest[a] - 1] (* Michael De Vlieger, Jan 03 2021 *)
PROG
(PARI) isok(n) = ispseudoprime(prime(n+1)^2 + prod(j=1, n, prime(j))); \\ Michel Marcus, Aug 26 2019
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Labos Elemer, May 04 2000
EXTENSIONS
a(12)-a(14) from Michel Marcus, Aug 26 2019
a(17) from Michael S. Branicky, Jun 09 2023
a(18) from Michael S. Branicky, Aug 09 2024
STATUS
approved