login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = Sum_{k=1..n} k * ceiling(n/k).
7

%I #29 Oct 22 2023 16:37:08

%S 1,4,10,18,30,42,61,77,101,124,153,177,218,246,285,325,373,409,467,

%T 507,570,624,683,731,816,873,942,1010,1095,1155,1258,1322,1418,1500,

%U 1589,1673,1801,1877,1976,2072,2203,2287,2426,2514,2643,2767,2886,2982,3155,3262

%N a(n) = Sum_{k=1..n} k * ceiling(n/k).

%F G.f.: x/(1 - x)^3 + (x/(1 - x)) * Sum_{k>=1} x^k / (1 - x^k)^2.

%F a(n) = n*(n + 1)/2 + Sum_{k=1..n-1} sigma(k).

%F a(n) ~ (6 + Pi^2)*n^2/12. - _Vaclav Kotesovec_, Mar 10 2020

%t Table[Sum[k Ceiling[n/k], {k, 1, n}], {n, 1, 50}]

%t Table[n (n + 1)/2 + Sum[DivisorSigma[1, k], {k, 1, n - 1}], {n, 1, 50}]

%t nmax = 50; CoefficientList[Series[x/(1 - x)^3 + (x/(1 - x)) Sum[x^k/(1 - x^k)^2, {k, 1, nmax}], {x, 0, nmax}], x] // Rest

%o (Magma) [&+[k*Ceiling(n/k):k in [1..n]]:n in [1..50]]; // _Marius A. Burtea_, Feb 16 2020

%o (PARI) a(n) = sum(k=1, n, k*ceil(n/k)); \\ _Michel Marcus_, Feb 17 2020

%o (Python)

%o from math import isqrt

%o def A332490(n): return n*(n+1)-(s:=isqrt(n-1))**2*(s+1)+sum((q:=(n-1)//k)*((k<<1)+q+1) for k in range(1,s+1))>>1 # _Chai Wah Wu_, Oct 22 2023

%Y Cf. A000203, A000217, A006590, A024916.

%K nonn

%O 1,2

%A _Ilya Gutkovskiy_, Feb 16 2020