%I #13 Aug 18 2018 08:44:12
%S 1,1,2,2,2,2,3,2,2,4,3,1,4,3,2,5,2,4,4,1,2,6,4,1,6,3,3,5,2,4,3,4,3,6,
%T 4,2,3,5,5,4,3,3,7,2,2,7,4,3,5,3,4,5,6,3,3,4,2,6,6,4,6,4,5,3,3,5,5,3,
%U 3,7,6,2,6,5,4,5,2,5,8,1,5,6,5,1,6,7,3,9,2,4,5,2,5,6,6,5,5,4,4,6,4,4,6,3,4
%N a(1)=1; for n > 1, a(n) = number of earlier terms a(k), 1 <= k <= n-1, such that (a(k)+n) is divisible by k.
%C The value of a(1) = 1 is arbitrary. a(1) can be any integer and the rest of the sequence would remain unchanged.
%H Robert Israel, <a href="/A127417/b127417.txt">Table of n, a(n) for n = 1..10000</a>
%e a(1)+11 = 12 is a multiple of 1; a(2)+11 = 12 is a multiple of 2; and a(7)+11 = 14 is a multiple of 7. These 3 are the only cases where (a(k)+11) is a multiple of k, for 1 <= k <= 10. So a(11) = 3.
%p N:= 200: # to get a(1)..a(N)
%p A[1]:= 1:
%p for n from 2 to N do
%p A[n]:= nops(select(t -> ((A[t]+n)/t)::integer, [$1..n-1]))
%p od:
%p seq(A[i],i=1..N); # _Robert Israel_, Aug 17 2018
%t f[l_List] := Block[{n = Length[l] + 1},Append[l, Count[Table[Mod[l[[k]] + n, k], {k, n - 1}], 0]]];Nest[f, {1}, 105] (* _Ray Chandler_, Jan 22 2007 *)
%Y Cf. A127418.
%K nonn
%O 1,3
%A _Leroy Quet_, Jan 13 2007
%E Extended by _Ray Chandler_, Jan 22 2007