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 #13 Sep 15 2020 21:07:39
%S 1,2,3,6,10,22,23,90,117,175,319,746,1264,3925,8313,10690,23566,64525,
%T 133493,380783,903835,2427039,6349271,16657466,24493816,74970066,
%U 84860988,133884920,144156567,630996725,637860615,2396049996,3819335725
%N a(0)=1. a(n) = a(n-1) + (sum of the earlier terms {among terms a(0) through a(n-1)} which are coprime to n).
%H Robert Israel, <a href="/A127076/b127076.txt">Table of n, a(n) for n = 0..3125</a>
%e The terms of the sequence, among terms a(0) through a(7), which are coprime to 8 are a(0)=1, a(2)=3 and a(6) = 23. So a(8) = a(7) +1 +3 +23 = 117.
%p R:= [1]:
%p for n from 1 to 100 do
%p x:= R[-1] + convert(select(t -> igcd(t,n)=1, R),`+`);
%p R:= [op(R),x];
%p od:
%p R; # _Robert Israel_, Sep 15 2020
%t f[l_List] := Append[l, l[[ -1]] + Plus @@ Select[l, GCD[ #, Length[l]] == 1 &]];Nest[f, {1}, 32] (* _Ray Chandler_, Jan 06 2007 *)
%Y Cf. A127075.
%K nonn
%O 0,2
%A _Leroy Quet_, Jan 04 2007
%E Extended by _Ray Chandler_, Jan 06 2007