OFFSET
0,3
COMMENTS
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..175
FORMULA
EXAMPLE
a(4) = 18 = 4+3+4+3+4 because the partitions of 4 are [1,1,1,1], [1,1,2], [2,2], [1,3], [4] and the largest inscribed rectangles have areas 4*1, 3*1, 2*2, 1*3, 1*4.
a(5) = 29 = 5+4+4+3+4+4+5 because the partitions of 5 are [1,1,1,1,1], [1,1,1,2], [1,2,2], [1,1,3], [2,3], [1,4], [5].
MAPLE
b:= proc(n, i, t, k) option remember; `if`(n=0, 1,
`if`(i=1, `if`(t+n>k, 0, 1), `if`(i<1, 0, b(n, i-1, t, k)
+add(`if`(t+j>k/i, 0, b(n-i*j, i-1, t+j, k)), j=1..n/i))))
end:
a:= n-> add(k*(b(n, n, 0, k) -b(n, n, 0, k-1)), k=1..n):
seq(a(n), n=0..50);
MATHEMATICA
b[n_, i_, t_, k_] := b[n, i, t, k] = If[n == 0, 1, If[i == 1, If[t + n > k, 0, 1], If[i < 1, 0, b[n, i - 1, t, k] + Sum[If[t + j > k/i, 0, b[n - i j, i - 1, t + j, k]], {j, 1, n/i}]]]];
a[n_] := Sum[k(b[n, n, 0, k] - b[n, n, 0, k - 1]), {k, 1, n}];
a /@ Range[0, 50] (* Jean-François Alcover, Dec 06 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Apr 11 2012
STATUS
approved