OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
Since the positive divisors of 10 are 1,2,5,10, a(10) = (the number of earlier terms coprime to 1, which is 9) + (the number of earlier terms coprime to 2, which is 5 for a(1)=1, a(4)=5, a(5)=7, a(7)=11 and a(8)=19) + (the number of earlier terms coprime to 5, which is 8 for every earlier term except a(4)=5) + (the number of earlier terms coprime to 10, which is 4) = 9 + 5 + 8 + 4 = 26.
MAPLE
A127791[1]:= 1:
S[1]:= {}:
for n from 2 to 1000 do
F:= ifactors(n)[2];
t:= 0;
for i from 1 to n-1 do
Fi:= remove(t -> member(t[1], S[i]), F);
t:= t + mul(f[2]+1, f=Fi);
od;
A127791[n]:= t;
S[n]:= numtheory[factorset](t);
od:
seq(A127791[n], n=1..1000); # Robert Israel, May 06 2014
MATHEMATICA
f[l_List] := Block[{n = Length[l] + 1, d = Divisors[n], c = 0}, Do[ c += Length[Select[l, GCD[ #, d[[i]]] == 1 &]]; , {i, Length[d]}]; Append[l, c]]; Nest[f, {1}, 64] (* Ray Chandler, Feb 08 2007 *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Leroy Quet, Jan 29 2007
EXTENSIONS
Extended by Ray Chandler, Feb 08 2007
STATUS
approved