OFFSET
1,4
EXAMPLE
a(10) = 12. Of the terms before that, a(1), a(2), a(3), a(4), a(5), and a(7) divide 12. Hence, a(11) = 1+2+3+4+5+7 = 22.
MATHEMATICA
a[1] = a[2] = 1; a[n_] := a[n] = Total[Select[Range[n - 2], Divisible[a[n - 1], a[#]] &]]; Array[a, 100] (* Amiram Eldar, Apr 30 2022 *)
PROG
(PARI) first(n) = { n = max(n, 2); res = List([1, 1]); for(i = 3, n, v = Vec(select(x->res[#res]%x == 0, res, 1))[^-1]; listput(res, vecsum(v)) ); res } \\ David A. Corneth, Apr 30 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric Fox, Apr 30 2022
STATUS
approved