OFFSET
0,3
COMMENTS
In the sum, the divisors are k = 1..n and the multipliers are the reverse n+1-k = n .. 1.
From Thomas Scheuerle, Jul 21 2022: (Start)
Without the floor operation a(n) would be A027457(n+1)/A099946(n+1) = (H(n+1) - 1)*(n^2+n), where H(n) is the n-th harmonic number.
What is lim_{n->oo} ((A027457(n+1)/A099946(n+1) - a(n))/(n^2+n))? It appears to be close to 0.2452... . (End)
This limit is equal to Pi^2/12 - gamma = 0.24525136852258... - Vaclav Kotesovec, Jul 23 2022
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..10000
FORMULA
From Vaclav Kotesovec, Jul 23 2022: (Start)
a(n) ~ n*(n+1)*(log(n) + 2*gamma - 1) - n^2*Pi^2/12, where gamma is the Euler-Mascheroni constant A001620. (End)
(1/(1-x)^2) * Sum_{k>0} x^k * (k - (k-1)*x - x^k)/(1-x^k)^2. - Seiichi Manyama, Jul 24 2022
EXAMPLE
For n=5, the sum is formed:
k = 1..n: 1 2 3 4 5
floor(n/k): 5 2 1 1 1
n+1-k = n..1: 5 4 3 2 1
floor(n/k)*(n+1-k): 25 8 3 2 1
__________________
a(5) = 25 + 8 + 3 + 2 + 1 = 39
MATHEMATICA
a[n_] := Sum[(n+1-k) * Floor[n/k], {k, 1, n}]; Array[a, 50, 0] (* Amiram Eldar, Jul 22 2022 *)
PROG
(PARI) a(n) = sum(k=1, n, (n+1-k)*floor(n/k)) \\ Rémy Sigrist, Jul 21 2022
(PARI) my(N=50, x='x+O('x^N)); concat(0, Vec(sum(k=1, N, x^k*(k-(k-1)*x-x^k)/(1-x^k)^2)/(1-x)^2)) \\ Seiichi Manyama, Jul 24 2022
(Python)
from math import isqrt
def A355947(n): return (s:=isqrt(n))**2*(s-(n<<1)-1)+sum((q:=n//k)*((n<<2)-(k<<1)-q+3) for k in range(1, s+1))>>1 # Chai Wah Wu, Oct 24 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Tamas Sandor Nagy, Jul 21 2022
EXTENSIONS
More terms from Rémy Sigrist, Jul 21 2022
STATUS
approved