OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
EXAMPLE
a(4) = 24 = 4+6+4+6+4 because the partitions of 4 are [1,1,1,1], [1,1,2], [2,2], [1,3], [4] and the bounding boxes have areas 4*1, 3*2, 2*2, 2*3, 1*4.
a(5) = 47 = 5+8+6+9+6+8+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) option remember; local f, g;
if n=0 or i=1 then [1, n]
elif i<1 then [0, 0]
else f:= b(n, i-1); g:= `if`(i>n, [0, 0], b(n-i, i));
[f[1]+g[1], f[2]+g[2]+g[1]]
fi
end:
a:= n-> add(add(i, i=b(n-j, min(j, n-j)))*j, j=1..n):
seq(a(n), n=0..40);
MATHEMATICA
b[n_, i_] := b[n, i] = Module[{f, g}, If[n == 0 || i == 1, {1, n}, If[i < 1, {0, 0}, f = b[n, i - 1]; g = If[i > n, {0, 0}, b[n - i, i]]]; {f[[1]] + g[[1]], f[[2]] + g[[2]] + g[[1]]}]]; a[n_] := Sum[Sum[i, {i, b[n - j, Min[j, n - j]]}]*j, {j, 1, n}]; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Feb 05 2017, translated from Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Apr 11 2012
STATUS
approved