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.
%I A338991 #16 Apr 19 2025 11:06:45 %S A338991 0,0,2,6,13,24,37,56,78,106,132,178,212,258,312,376,425,508,565,662, %T A338991 749,836,909,1058,1156,1264,1384,1536,1636,1836,1946,2126,2282,2434, %U A338991 2606,2880,3019,3194,3385,3676,3833,4138,4305,4572,4863,5086,5271,5692,5924,6240 %N A338991 a(n) = Sum_{k=1..floor(n/2)} (n-2*k) * floor((n-k)/k). %C A338991 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). %F A338991 From _Vaclav Kotesovec_, Jun 24 2021: (Start) %F A338991 a(n) = n + n*A006218(n) - 2*A024916(n). %F A338991 a(n) ~ (log(n) + 2*gamma - Pi^2/6 - 1)*n^2, where gamma is the Euler-Mascheroni constant A001620. (End) %t A338991 Table[Sum[(n - 2 k)*Floor[(n - k)/k], {k, Floor[n/2]}], {n, 60}] %o A338991 (Python) %o A338991 from math import isqrt %o A338991 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 %Y A338991 Cf. A001620, A002541, A006218, A024916, A153485, A279847, A339370. %K A338991 nonn,easy %O A338991 1,3 %A A338991 _Wesley Ivan Hurt_, Dec 21 2020