OFFSET
1,1
LINKS
Tyler Busby, Table of n, a(n) for n = 1..37 (terms 1..36 from Robert Price)
MAPLE
spf:= proc(n) local F;
F:= select(type, map(t -> t[1], ifactors(n, easy)[2]), integer);
if F <> [] then min(F)
else min(numtheory:-factorset(n))
fi
end proc:
a[1]:= 31:
for i from 2 to 31 do
a[i]:= spf(1 + mul(a[j], j=1..i-1))
od:
seq(a[i], i=1..31); # Robert Israel, Nov 25 2015
MATHEMATICA
a[1]=31; a[n_] := First[ Flatten[ FactorInteger[ 1+Product[ a[ j ], {j, 1, n-1} ] ] ] ]; Array[a, 10]
PROG
(PARI) gpf(n)=my(f=factor(n)[, 1]); f[#f];
first(m)=my(v=vector(m)); v[1]=31; for(i=2, m, v[i]=gpf(1+prod(j=1, i-1, v[j]))); v \\ Anders Hellström, Nov 25 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
STATUS
approved