login

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”).

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

%I #32 Sep 30 2018 20:24:54

%S 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,

%T 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,

%U 2,641,2,3,2,5,2,3,2,17,2,3,2,5,2,3

%N 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)).

%H Antti Karttunen, <a href="/A260218/b260218.txt">Table of n, a(n) for n = 1..255</a>

%F It appears that for odd k, a(k) = 2 and for even k, a(k) = A002586(k/2). - _Michel Marcus_, Jul 20 2015

%t 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 *)

%o (PARI) spf(n)=factor(n)[1, 1]

%o 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 */

%o (PARI)

%o A020639(n) = if(1==n,n,vecmin(factor(n)[, 1]));

%o memoA260218 = Map();

%o 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

%Y Cf. A000945, A005265, A007978, A053669, A075019, A258581.

%K nonn,less

%O 1,1

%A _Anders Hellström_, Jul 19 2015