OFFSET
1,2
REFERENCES
H. Dubner, Recursive Prime Generating Sequences, Table 4 pp. 173 Journal of Recreational Mathematics 29(3) 1998 Baywood NY.
LINKS
Charles R Greathouse IV and T. D. Noe, Table of n, a(n) for n = 1..500 (first 200 terms from Noe)
EXAMPLE
1*2*3*5 + 1 = 31 is prime.
MATHEMATICA
a[1] = 1; p[1] = 1;
a[n_] := a[n] = For[an = a[n-1] + 1, True, an++, pn = p[n-1]*an; If[ PrimeQ[pn+1], p[n] = pn; Return[an] ] ];
Table[a[n], {n, 1, 60}]
(* Jean-François Alcover, Sep 17 2012 *)
Module[{cc={1}, k}, Do[k=Last[cc]+1; While[!PrimeQ[Times@@Join[cc, {k}]+1], k++]; AppendTo[cc, k], {60}]; cc] (* Harvey P. Dale, Jan 21 2013 *)
nxt[{t_, a_}]:=Module[{k=a+1}, While[CompositeQ[t*k+1], k++]; {t*k, k}]; NestList[nxt, {1, 1}, 60][[All, 2]] (* Harvey P. Dale, May 22 2021 *)
PROG
(PARI) first(n)=my(v=vector(n), N=1, t=1); v[1]=1; for(k=2, n, while(!ispseudoprime(1 + N*t++), ); N*=v[k]=t); v \\ Charles R Greathouse IV, Apr 07 2020
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
More terms from Jason Earls, Jan 25 2002
Definition corrected by T. D. Noe, Feb 14 2007
STATUS
approved