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
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Apr 29 2021
STATUS
approved