cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A355947 a(n) = Sum_{k=1..n} (n+1-k)*floor(n/k).

Original entry on oeis.org

0, 1, 5, 12, 25, 39, 65, 87, 124, 161, 210, 249, 328, 377, 450, 531, 630, 698, 825, 903, 1047, 1169, 1295, 1393, 1609, 1740, 1893, 2056, 2269, 2400, 2679, 2822, 3070, 3277, 3486, 3709, 4082, 4260, 4498, 4748, 5136, 5336, 5744, 5956, 6312, 6686, 6984, 7218, 7772
Offset: 0

Views

Author

Tamas Sandor Nagy, Jul 21 2022

Keywords

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

Examples

			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
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[(n+1-k) * Floor[n/k], {k, 1, n}]; Array[a, 50, 0] (* Amiram Eldar, Jul 22 2022 *)
  • 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

Formula

From Vaclav Kotesovec, Jul 23 2022: (Start)
For n > 0, a(n) = (n+1)*A006218(n) - A024916(n).
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

Extensions

More terms from Rémy Sigrist, Jul 21 2022