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.

A338991 a(n) = Sum_{k=1..floor(n/2)} (n-2*k) * floor((n-k)/k).

Original entry on oeis.org

0, 0, 2, 6, 13, 24, 37, 56, 78, 106, 132, 178, 212, 258, 312, 376, 425, 508, 565, 662, 749, 836, 909, 1058, 1156, 1264, 1384, 1536, 1636, 1836, 1946, 2126, 2282, 2434, 2606, 2880, 3019, 3194, 3385, 3676, 3833, 4138, 4305, 4572, 4863, 5086, 5271, 5692, 5924, 6240
Offset: 1

Views

Author

Wesley Ivan Hurt, Dec 21 2020

Keywords

Comments

Total area of all rectangles with dimensions (y-x) X (z) where x and y are integers such that x + y = n, 0 < x <= y, and z = floor(y/x).

Crossrefs

Programs

  • Mathematica
    Table[Sum[(n - 2 k)*Floor[(n - k)/k], {k, Floor[n/2]}], {n, 60}]
  • Python
    from math import isqrt
    def A338991(n): return ((s:=isqrt(n))+1)*(n*(1-s)+s**2)-sum((q:=n//k)*((k-n<<1)+q+1) for k in range(1,s+1)) # Chai Wah Wu, Oct 23 2023

Formula

From Vaclav Kotesovec, Jun 24 2021: (Start)
a(n) = n + n*A006218(n) - 2*A024916(n).
a(n) ~ (log(n) + 2*gamma - Pi^2/6 - 1)*n^2, where gamma is the Euler-Mascheroni constant A001620. (End)