OFFSET
0,5
COMMENTS
Consider the m x k rectangle corresponding to an integer partition p of n, where m is the greatest part of p and k is the number of parts of p. Fit the Ferrers diagram of p inside its corresponding rectangle. a(n) is the number of empty spaces in all such rectangles over all partitions of n.
REFERENCES
Sriram Pemmaraju and Steven Skiena, Computational Discrete Mathematics, Cambridge, 2003, page 145.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = Sum_{k>0} k*A268192(n,k). - Alois P. Heinz, Feb 12 2016
EXAMPLE
a(4) = 4 because the partitions 4, 2+2, 1+1+1+1 have no empty spaces while the partitions 3+1 and 2+1+1 each have two.
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) -n*b(n, n)[1]:
seq(a(n), n=0..40); # Alois P. Heinz, Apr 22 2011, Apr 11 2012
MATHEMATICA
f[list_]:= Total[Select[Reverse[Table[Max[list]-list[[i]], {i, 1, Length[list]}]], #>0&]];
Table[Total[Map[f, IntegerPartitions[n]]], {n, 0, 30}]
(* second program: *)
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}]-n*b[n, n][[1]];
Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Aug 30 2016, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Geoffrey Critzer, Apr 22 2011
STATUS
approved