Given a $M \times N$ rectangle $r$, a partition $p$ of $r$ is a collection of rectangles with area smaller or equal than $r$ that cover $r$. The histogram of a partition $h(p)$ is the frequency distribution of rectangle areas in $p$. For example, for a $2 \times 2$ rectangle, we can have only $4$ different histograms resulting from its partitions:
\begin{align} p_1 &= [4,0,0,0];\\ p_2 &= [0,2,0,0];\\ p_3 &= [2,1,0,0];\\ p_4 &= [0,0,0,1]; \end{align} where $p_n[i]$ is the # of rectangles of area $i$ in the partition (the array is one-based).
Note that the smaller possible rectangle is $(1,1)$, and only rectangles with integer dimensions are considered.
So how can I count the number of distinct histograms resulting from all possible partitions of a $M \times N$ rectangle?
The problem is very similar to this, but in that problem order and position matter, while in my problem all I care about is the distribution of rectangle areas.