login
A265009
a(1)=3; for n>1, if n is odd a(n) = spf(Product_{k=1..n-1}(a(k))+1) else a(n) = spf(Product_{k=1..n-1}(a(k))-1), where spf is "smallest prime factor".
0
3, 2, 7, 41, 1723, 5, 14835031, 220078129935929, 241, 23, 79, 101, 23291, 11, 223, 122386298896281959929015788890561251765109069, 38803, 17, 8209, 59, 199, 3340389589, 11527, 13, 47939, 1163, 599, 27198087874669514440553, 181936481, 31, 383, 9623, 739, 33287, 1061, 6493520653, 587, 709, 6548057, 1823, 361789, 20183
OFFSET
1,1
MATHEMATICA
a[1] = 3; a[n_] := a[n] = FactorInteger[ Product[a[k], {k, n - 1}] + If[OddQ@ n, 1, -1]][[1, 1]]; Array[a, {16}] (* Michael De Vlieger, Nov 30 2015 *)
PROG
(PARI) spf(n)=my(f=factor(n)[1, 1]); f
first(m)=my(v=vector(m)); v[1]=3; for(i=2, m,; v[i]=spf((-1)^(i+1)+prod(j=1, i-1, v[j]))); v
CROSSREFS
Sequence in context: A176802 A363400 A230710 * A358656 A021757 A143312
KEYWORD
nonn
AUTHOR
Anders Hellström, Nov 30 2015
EXTENSIONS
a(20)-a(42) from Hans Havermann, Dec 06 2015
STATUS
approved