login
A260218
a(1) = 2; for n > 1 if n is even a(n) = spf(1 + Product_{odd m,m<n}a(m)), while if n is odd a(n) = spf(1 + Product_{even m,m<n}a(m)).
1
2, 3, 2, 5, 2, 3, 2, 17, 2, 3, 2, 5, 2, 3, 2, 257, 2, 3, 2, 5, 2, 3, 2, 17, 2, 3, 2, 5, 2, 3, 2, 65537, 2, 3, 2, 5, 2, 3, 2, 17, 2, 3, 2, 5, 2, 3, 2, 97, 2, 3, 2, 5, 2, 3, 2, 17, 2, 3, 2, 5, 2, 3, 2, 641, 2, 3, 2, 5, 2, 3, 2, 17, 2, 3, 2, 5, 2, 3
OFFSET
1,1
LINKS
FORMULA
It appears that for odd k, a(k) = 2 and for even k, a(k) = A002586(k/2). - Michel Marcus, Jul 20 2015
MATHEMATICA
f[n_] := Block[{a = {2}, k, m}, Do[If[EvenQ@ k, AppendTo[a, FactorInteger[Product[a[[m]], {m, 1, k - 1, 2}] + 1][[1, 1]]], AppendTo[a, FactorInteger[Product[a[[m]], {m, 2, k - 1, 2}] + 1][[1, 1]]]], {k, 2, n}]; a]; f@ 80 (* Michael De Vlieger, Jul 20 2015 *)
PROG
(PARI) spf(n)=factor(n)[1, 1]
first(m)=my(v=vector(m), i, odd=2, even=1); v[1]=2; for(i=2, m, if(i%2==0, v[i]=spf(odd+1); even*=v[i], v[i]=spf(even+1); odd*=v[i])); v; /* Anders Hellström, Jul 19 2015 */
(PARI)
A020639(n) = if(1==n, n, vecmin(factor(n)[, 1]));
memoA260218 = Map();
A260218(n) = if(1==n, 2, if(mapisdefined(memoA260218, n), mapget(memoA260218, n), my(k, m, v = if(!(n%2), k=1; m=1; while(k<n, m *= A260218(k); k += 2); A020639(m+1), k=2; m=1; while(k<n, m * A260218(k); k += 2); A020639(m+1))); mapput(memoA260218, n, v); (v))); \\ (An incrementally memoized version). Antti Karttunen, Sep 30 2018
CROSSREFS
KEYWORD
nonn,less
AUTHOR
Anders Hellström, Jul 19 2015
STATUS
approved