OFFSET
1,2
COMMENTS
For 1 <= k <= n, add 1 if k|n, otherwise add k. For example, a(12) = 1 + 1 + 1 + 1 + 5 + 1 + 7 + 8 + 9 + 10 + 11 + 1 = 56.
If p is prime, a(p) = p*(p+1)/2 - sigma(p) + d(p) = p*(p+1)/2 - (p+1) + 2 = 1 + p*(p-1)/2.
FORMULA
a(n) = Sum_{k=1..n} k^(ceiling(n/k)-floor(n/k)).
EXAMPLE
a(10) = 10*(10+1)/2 - sigma(10) + d(10) = 55 - 18 + 4 = 41.
MATHEMATICA
Table[n (n + 1)/2 - DivisorSigma[1, n] + DivisorSigma[0, n], {n, 80}]
PROG
(PARI) a(n) = n*(n+1)/2 - sigma(n) + numdiv(n); \\ Michel Marcus, May 25 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, May 24 2021
STATUS
approved