login
A366983
a(n) = Sum_{k=1..n} (k+1) * floor(n/k).
3
2, 7, 13, 23, 31, 47, 57, 76, 92, 114, 128, 162, 178, 206, 234, 270, 290, 335, 357, 405, 441, 481, 507, 575, 609, 655, 699, 761, 793, 873, 907, 976, 1028, 1086, 1138, 1238, 1278, 1342, 1402, 1500, 1544, 1648, 1694, 1784, 1868, 1944, 1994, 2128, 2188, 2287, 2363, 2467
OFFSET
1,1
FORMULA
a(n) = A006218(n) + A024916(n).
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
Partial sums of A007503.
Sequence in context: A010895 A045376 A185724 * A045377 A180470 A237443
KEYWORD
nonn,easy
AUTHOR
Seiichi Manyama, Oct 30 2023
STATUS
approved