login
A353199
a(1)=a(2)=1. a(n) = the sum of the indices of the terms, from among the first (n-2) terms of the sequence, which divide a(n-1).
0
1, 1, 1, 3, 6, 10, 6, 15, 10, 12, 22, 6, 22, 17, 6, 34, 20, 21, 10, 21, 28, 6, 49, 6, 71, 6, 95, 6, 121, 6, 149, 6, 179, 6, 211, 6, 245, 29, 6, 281, 6, 320, 57, 10, 40, 101, 6, 361, 6, 408, 497, 31, 6, 457, 6, 510, 681, 10, 84, 634, 6, 565, 6, 626, 6, 689, 6, 754, 44, 30, 965
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
Cf. A124063.
Sequence in context: A080817 A139762 A055262 * A138797 A333576 A009019
KEYWORD
nonn
AUTHOR
Eric Fox, Apr 30 2022
STATUS
approved