OFFSET
1,1
FORMULA
G.f.: 1/(1-x) * Sum_{k>0} (1/(1-x^k)^2 - 1) = 1/(1-x) * Sum_{k>0} (k+1) * x^k/(1-x^k).
a(n) = A257644(n) - 1. - Hugo Pfoertner, Oct 31 2023
PROG
(PARI) a(n) = sum(k=1, n, (k+1)*(n\k));
(Python)
from math import isqrt
def A366983(n): return -(s:=isqrt(n))*(s*(s+4)+5)+sum(((q:=n//w)+1)*(q+(w<<1)+4) for w in range(1, s+1))>>1 # Chai Wah Wu, Oct 31 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Seiichi Manyama, Oct 30 2023
STATUS
approved