login
A343803
a(n) = Sum_{k=1..n} k * (number of divisors of n <= k).
0
1, 5, 9, 23, 20, 65, 35, 109, 96, 164, 77, 377, 104, 307, 362, 525, 170, 818, 209, 1008, 690, 725, 299, 2005, 665, 1000, 1122, 1939, 464, 3106, 527, 2517, 1658, 1682, 1894, 5084, 740, 2089, 2298, 5500, 902, 6022, 989, 4701, 5066, 3035, 1175, 10117, 2478, 6069, 3890, 6532, 1484
OFFSET
1,2
COMMENTS
If n is prime, then a(n) = n*(n+3)/2.
FORMULA
a(n) = Sum_{k=1..n} Sum_{i=1..k} k * (1 - ceiling(n/i) + floor(n/i)).
EXAMPLE
a(4) = 1*(1) + 2*(2) + 3*(2) + 4*(3) = 23, i.e.,
(1 times the number of divisors of 4 that are less than or equal to 1)
+ (2 times the number of divisors of 4 that are less than or equal to 2)
+ (3 times the number of divisors of 4 that are less than or equal to 3)
+ (4 times the number of divisors of 4 that are less than or equal to 4).
MATHEMATICA
Table[Sum[Sum[k (1 - Ceiling[n/i] + Floor[n/i]), {i, k}], {k, n}], {n, 60}]
PROG
(PARI) a(n) = my(d=divisors(n)); sum(k=1, n, k*#select(x->(x<=k), d)); \\ Michel Marcus, Apr 30 2021
CROSSREFS
Cf. A081307.
Sequence in context: A215178 A058893 A263830 * A194802 A229925 A280030
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Apr 29 2021
STATUS
approved