A102128 a(1) = 1; a(n) = sum of previous terms which divide n.
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, 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, 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
Offset: 1
Keywords
Examples
Among the first 7 terms, the terms which divide 8 are 1, 1, 2, 4, 2 and 2. So a(8) = 1 + 1 + 2 + 4 + 2 + 2 = 12.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..20000
Crossrefs
Cf. A088167.
Programs
-
Mathematica
Nest[Function[{a, n}, Append[a, Total@ Select[a, Mod[n, #] == 0 &]]] @@ {#, Length@ # + 1} &, {1}, 80] (* Michael De Vlieger, Nov 13 2018 *)
-
PARI
up_to = 20000; 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); }; v102128 = A102128list(up_to); A102128(n) = v102128[n]; \\ Antti Karttunen, Nov 10 2018
Formula
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
Extensions
More terms from John W. Layman, Mar 16 2005