OFFSET
1,1
COMMENTS
139 was chosen because of the relatively small initial values a(1), .., a(16).
LINKS
Planetmath.org, Variants of the Euclid-Mullin sequence
Pollack, Paul; Treviño, Enrique, The Primes that Euclid Forgot.
MATHEMATICA
f[1] = 139; f[n_] := f[n] = FactorInteger[Product[f[i], {i, 1, n - 1}] + 1][[1, 1]] ; Table[f[n], {n, 1, 20}] (* Michael De Vlieger, Aug 28 2015, after program at A000945 *)
PROG
(PARI) spf(n)=factor(n)[1, 1]
first(m)=my(v=vector(m)); v[1]=139; print1(v[1], ", "); for(i=2, m, v[i]=spf(1+prod(k=1, i-1, v[k]));; print1(v[i], ", ")); v;
CROSSREFS
KEYWORD
nonn
AUTHOR
Anders Hellström, Aug 28 2015
EXTENSIONS
More terms from Jinyuan Wang, Jul 02 2022
a(34) from Tyler Busby, Oct 12 2023
STATUS
approved