OFFSET
1,1
EXAMPLE
2*2-1 = 3, (2*2-1)^2-2 = 7, 3 and 7 are primes, so a(1) = 2.
11*2*3*5*7-1 = 2309, (11*2*3*5*7-1)^2-2 = 5331479, 2309 and 5331479 are primes, so a(4) = 11.
MATHEMATICA
chenQ[n_] := PrimeQ[n] && PrimeOmega[n+2] <= 2; a[n_] := Module[{p = Product[Prime[i], {i, 1, n}], k = 0}, While[!PrimeQ[k*p - 1] || !chenQ[(k*p-1)^2-2], k++]; k]; Array[a, 60] (* Amiram Eldar, Sep 11 2021 *)
PROG
(PARI) isok(k, q) = if (isprime(k*q-1), my(c=(k*q-1)^2-2); (isprime(c) && (bigomega(c+2)<=2)));
a(n) = my(k=1, q=prod(i=1, n, prime(i))); while (!isok(k, q), k++); k; \\ Michel Marcus, Sep 11 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Sep 21 2005
STATUS
approved