login
a(1) = 1; a(n) = sum of previous terms which divide n.
1

%I #17 Dec 01 2018 09:25:10

%S 1,1,2,4,2,6,2,12,2,10,2,34,2,14,2,20,2,24,2,54,2,22,2,70,2,26,2,46,2,

%T 46,2,36,2,68,2,94,2,38,2,74,2,62,2,70,2,138,2,94,2,60,2,82,2,114,2,

%U 74,2,58,2,172,2,124,2,68,2,94,2,242,2,234,2,154,2,222,2,118,2,110,2,114,2

%N a(1) = 1; a(n) = sum of previous terms which divide n.

%H Antti Karttunen, <a href="/A102128/b102128.txt">Table of n, a(n) for n = 1..20000</a>

%F a(1) = 1; a(n) = [x^n] Sum_{k=1..n-1} a(k)*x^a(k)/(1 - x^a(k)). - _Ilya Gutkovskiy_, Dec 11 2017

%e Among the first 7 terms, the terms which divide 8 are 1, 1, 2, 4, 2 and 2.

%e So a(8) = 1 + 1 + 2 + 4 + 2 + 2 = 12.

%t Nest[Function[{a, n}, Append[a, Total@ Select[a, Mod[n, #] == 0 &]]] @@ {#, Length@ # + 1} &, {1}, 80] (* _Michael De Vlieger_, Nov 13 2018 *)

%o (PARI)

%o up_to = 20000;

%o A102128list(up_to) = { my(v=vector(up_to)); v[1] = 1; for(n=2,up_to,v[n] = sum(j=1,n-1,v[j]*!(n%v[j]))); (v); };

%o v102128 = A102128list(up_to);

%o A102128(n) = v102128[n]; \\ _Antti Karttunen_, Nov 10 2018

%Y Cf. A088167.

%K nonn

%O 1,3

%A _Leroy Quet_, Feb 14 2005

%E More terms from _John W. Layman_, Mar 16 2005