OFFSET
1,2
EXAMPLE
1*((2*3)^2)-1 = 35 is composite, 2*((2*3)^2)-1 = 71 is prime, 2*((2*3)^2)+1 = 73 is prime twin of 71 so a(2) = 2.
MATHEMATICA
a[n_] := Module[{k = 1, p = Product[Prime[i], {i, 1, n}]}, While[!(PrimeQ[k*p^2-1] && NextPrime[k*p^2-1] == k*p^2+1), k++]; k]; Array[a, 50] (* Amiram Eldar, Jul 17 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Mar 23 2005
EXTENSIONS
More terms from Amiram Eldar, Jul 17 2021
STATUS
approved