OFFSET
1,3
COMMENTS
For all k from 1 to n, add (n-k) if k|n, otherwise add 1 (see example).
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
FORMULA
a(p) = 2p-3 for primes p. - Wesley Ivan Hurt, Nov 28 2021
EXAMPLE
a(8) = 21, since for k = 1..8, we have: (8-1) + (8-2) + 1 + (8-4) + 1 + 1 + 1 + (8-8) = 21.
MATHEMATICA
Table[Sum[(n - k)^(1 - Ceiling[n/k] + Floor[n/k]), {k, n}], {n, 100}]
PROG
(PARI) a(n) = sum(k=1, n, if (n % k, 1, n-k)); \\ Michel Marcus, Nov 25 2021
(Python)
from sympy import divisor_sigma
def A349680(n): return n+(n-1)*divisor_sigma(n, 0)-divisor_sigma(n, 1) # Chai Wah Wu, Nov 25 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Nov 24 2021
STATUS
approved