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