login
A332623
a(n) = Sum_{k=1..n} ceiling(n/k)^2.
3
1, 5, 14, 25, 43, 58, 87, 106, 141, 171, 212, 239, 302, 333, 386, 439, 507, 546, 631, 674, 765, 834, 911, 962, 1091, 1157, 1246, 1331, 1450, 1513, 1666, 1733, 1866, 1967, 2080, 2181, 2373, 2452, 2577, 2694, 2883, 2970, 3171, 3262, 3437, 3600, 3749, 3848, 4107, 4225
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
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Feb 17 2020
STATUS
approved