OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..184
MATHEMATICA
a[1] = 4; a[n_] := a[n] = For[k = a[n-1]+1, True, k++, p = Times @@ Array[a, n-1]; If[PrimeQ[k*p+1] && PrimeQ[k*p-1], Print[k]; Return[k]]]; Array[a, 45] (* Jean-François Alcover, Oct 23 2016 *)
PROG
(PARI) lista(nn) = {my (v = vector(nn)); for (n = 1, nn, if (n == 1, p = 1; k = 0; , p = prod(j=1, n-1, v[j]); k = v[n-1]+1); while (! isprime(p*k+1) || ! isprime(p*k-1), k++); v[n] = k; print1(k, ", "); ); } \\ Michel Marcus, Sep 28 2013
CROSSREFS
KEYWORD
nice,nonn
AUTHOR
Felice Russo, Dec 21 1999
EXTENSIONS
More terms from Michel Marcus, Sep 28 2013
STATUS
approved