C4. An integer container $(x, y, z)$ is a rectangular prism with positive integer side lengths $x, y, z$, where $x \leq y \leq z$. A stick has $x=y=1$; a flat has $x=1$ and $y>1$; and a box has $x>1$. There are 5 integer containers with volume 30: one stick $(1,1,30)$, three flats $(1,2,15),(1$, $3,10),(1,5,6)$ and one box $(2,3,5)$.
a. How many sticks, flats and boxes are there among the integer containers with volume 36 ?
b. How many flats and boxes are there among the integer containers with volume 210 ?
c. Suppose $n=p_{1}^{e_{1}} \cdots p_{k}^{e_{k}}$ has $k$ distinct prime factors $p_{1}, p_{2}, \ldots, p_{k}$, each with integer exponent $e_{1} \geq 1, e_{2} \geq 1, \ldots, e_{k} \geq 1$ and $k \geq 3$. How many boxes are there among the integer containers with volume $n$ ? Express your answer in terms of $e_{1}, e_{2}, \ldots, e_{k}$. How many boxes with volume $n=8!$ are there?
Solution: There is always one stick for every volume. To count flats with volume $n$, we want pairs $(y, z)$ with $1<y \leq z$ and $y z=n$, so we can count divisors of $n$ and discard the pair $(1, n)$. That is, if $d(n)$ is the number of divisors of $n$, the number of flats is $(d(n)-2) / 2$ if $n$ is not a perfect square, and $(d(n)-1) / 2$ if $n$ is a perfect square.
a. There is one stick $(1,1,36)$ with volume 36 , and four flats, by the divisor counting argument since $d(36)=9$. Or, explicitly, the flats are $(1,2,18),(1,3,12),(1,4,9)$, and $(1,6,6)$.
To count boxes, we can directly find them all by case work: $(2,2,9),(2,3,6),(3,3,4)$. Alternatively, for each box, we can distribute the primes $2,2,3,3$ to three sides, so that each side gets at least one prime factor. In this case, there must be one side that is a product of two primes (maybe not distinct), and there are three ways to do this.
Answer: $1,4,3$.
b. We have $210=2 \cdot 3 \cdot 5 \cdot 7$, so that $d(210)=2^{4}$, and hence there are 7 flats. To count boxes, we note that one side length must be a product of two primes, while the other two are prime. There are $\binom{4}{2}=6$ ways to choose two of the four, so there are 6 boxes.
Explicitly, the boxes are $(2,3,35),(2,5,21),(2,7,15),(3,5,14),(3,7,10),(5,6,7)$.
c. We first count the number of containers with volume $n, C_{n}$, followed by the number of flats, $F_{n}$. We then desire $C_{n}-F_{n}-1$, as there is one stick of volume $n$.
There are three kinds of containers: ones where no two dimensions are equal, ones where two dimensions are equal, and ones where all three dimensions are equal. Call the number of such containers $C_{1, n}, C_{2, n}$, and $C_{3, n}$, respectively. Note that $C_{3, n}=1$ when all $e_{i}$ are multiples of 3 , and $C_{3, n}=0$ otherwise.
To count $C_{2, n}$, we first count the number of triplets $(x, y, z)$ of positive integers with $x y z=n$ and $x=y$. We see that there are $\left\lfloor\frac{e_{i}}{2}\right\rfloor+1$ ways to choose the number of factors of $p_{i}$ in each of the three dimensions (we may choose the power of $p_{i}$ in $x$ as $0,1, \ldots,\left\lfloor e_{i} / 2\right\rfloor$ ). Each of these triplets corresponds to exactly one container, so there are
$$
C_{2, n}+C_{3, n}=\prod_{i=1}^{k}\left(\left\lfloor\frac{e_{i}}{2}\right\rfloor+1\right)
$$
containers where at least two dimensions are equal.
Finally, to count $C_{1, n}$, we first count the number of triplets $(x, y, z)$ of positive integers with $x y z=n$. For each $p_{i}$, there are $\binom{e_{i}+2}{2}$ ways to distribute its divisors among $x, y$, and $z$. Here, every element of $C_{1, n}$ is counted six times, every element of $C_{2, n}$ is counted thrice, and every element of $C_{3, n}$ is counted once, whence
$$
6 C_{1, n}+3 C_{2, n}+C_{3, n}=\prod_{i=1}^{k}\binom{e_{i}+2}{2} .
$$

Combining all of this together (adding the last equation with thrice the first one), we have
$$
C_{n}=C_{1, n}+C_{2, n}+C_{3, n}=\frac{1}{6}\left(\prod_{i=1}^{k}\binom{e_{i}+2}{2}+3 \prod_{i=1}^{k}\left(\left\lfloor\frac{e_{i}}{2}\right\rfloor+1\right)+\left\{\begin{array}{ll}
2 & \text { if } 3 \mid e_{i} \text { for all } i \\
0 & \text { otherwise }
\end{array}\right)\right.
$$

Now we deal with flats. For every unordered pair of divisors of $n,(k, n / k)$, there is a flat with dimensions $1, k, n / k$ in some order, provided $k \neq 1, n$. The number of such unordered pairs is
$$
F_{n}=\frac{1}{2}\left(\prod_{i=1}^{k}\left(e_{i}+1\right)-2+\left\{\begin{array}{ll}
1 & \text { if } 2 \mid e_{i} \text { for all } i \\
0 & \text { otherwise }
\end{array}\right) .\right.
$$

Now we specialize to the case $n=8!=2^{7} \cdot 3^{2} \cdot 5 \cdot 7$.
We see that
$$
C_{n}=\frac{1}{6}\left(\binom{9}{2}\binom{4}{2}\binom{3}{2}\binom{3}{2}+3 \cdot 4 \cdot 2\right)=328
$$
and
$$
F_{n}=\frac{1}{2}(8 \cdot 3 \cdot 2 \cdot 2-2)=47 \text {, }
$$
so the number of boxes is
$$
C_{n}-F_{n}-1=280 .
$$