OFFSET
1,2
COMMENTS
For all 1 <= k <= n, if k|n then add k to a running total, otherwise add n. (For example, a(9) = 1 + 9 + 3 + 9 + 9 + 9 + 9 + 9 + 9 = 67, where each divisor of 9 appears in fixed order from 1..9 and 9's appear everywhere else.)
If p is prime, a(p) = p^2 + sigma(p) - p*d(p) = p^2 - p + 1.
FORMULA
a(n) = n * Sum_{k=1..n} 1 / k^c(n/k), where c(n) = 1 - ceiling(n) + floor(n).
EXAMPLE
a(6) = 6^2 + sigma(6) - 6*d(6) = 36 + 12 - 24 = 24.
MATHEMATICA
Table[n^2 + DivisorSigma[1, n] - n*DivisorSigma[0, n], {n, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, May 20 2021
STATUS
approved