Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #26 Dec 06 2015 15:12:49
%S 3,2,7,41,1723,5,14835031,220078129935929,241,23,79,101,23291,11,223,
%T 122386298896281959929015788890561251765109069,38803,17,8209,59,199,
%U 3340389589,11527,13,47939,1163,599,27198087874669514440553,181936481,31,383,9623,739,33287,1061,6493520653,587,709,6548057,1823,361789,20183
%N 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".
%t 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 *)
%o (PARI) spf(n)=my(f=factor(n)[1, 1]); f
%o 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
%Y Cf. A000945, A005265.
%K nonn
%O 1,1
%A _Anders Hellström_, Nov 30 2015
%E a(20)-a(42) from _Hans Havermann_, Dec 06 2015