OFFSET
0,3
LINKS
Nick MacKinnon, Problem 10883, Amer. Math. Monthly, 108 (2001) 565; solution by John C. Cock, 110 (2003) 343-344.
FORMULA
a(n) = Sum_{k=1..n} k*ceiling(d(k)/2), where d(k)=A000005(k) is the number of divisors of k.
a(n) = Sum_{r=1..floor(sqrt(n))} r*(r+floor(n/r))*(floor(n/r)+1-r)/2.
a(n) ~ n^2 * log(n) / 4
G.f.: x*f'(x)/(1 - x), where f(x) = Sum_{k>=1} x^k^2/(1 - x^k). - Ilya Gutkovskiy, Apr 12 2017
EXAMPLE
a(5)=19, the rectangles being 1 X 1, 1 X 2, 1 X 3, 1 X 4, 1 X 5 and 2 X 2.
MATHEMATICA
a[n_] := Sum[r(r+Floor[n/r])(Floor[n/r]+1-r), {r, 1, Floor[Sqrt[n]]}]/2
PROG
(Python)
from math import isqrt
def A083356(n): return (k:=isqrt(n))*(k+1)*(2+4*k-3*k*(k+1))//24+sum(i*(m:=n//i)*(1+m)>>1 for i in range(1, k+1)) # Chai Wah Wu, Jul 11 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Dean Hickerson, Apr 26 2003
STATUS
approved