OFFSET
1,2
FORMULA
G.f.: x/(1 - x)^2 + (x/(1 - x)) * Sum_{k>=1} (2*k + 1) * x^k / (1 - x^k).
a(n) = n + Sum_{k=1..n-1} (2*sigma(k) + d(k)).
a(n) ~ n^2 * Pi^2 / 6. - Vaclav Kotesovec, Feb 20 2020
MATHEMATICA
Table[Sum[Ceiling[n/k]^2, {k, 1, n}], {n, 1, 50}]
Table[n + Sum[2 DivisorSigma[1, k] + DivisorSigma[0, k], {k, 1, n - 1}], {n, 1, 50}]
nmax = 50; CoefficientList[Series[x/(1 - x)^2 + x/(1 - x) Sum[(2 k + 1) x^k/(1 - x^k), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
PROG
(Magma) [&+[Ceiling(n/k)^2:k in [1..n]]:n in [1..50]]; // Marius A. Burtea, Feb 17 2020
(Python)
from math import isqrt
def A332623(n): return n-(s:=isqrt(n-1))**2*(s+2)+sum((q:=(n-1)//k)*((k<<1)+q+3) for k in range(1, s+1)) # Chai Wah Wu, Oct 24 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Feb 17 2020
STATUS
approved