5.22 Let \( r \) and \( s \) be positive integers. Derive a formula for the number of ordered quadruples of positive integers \((a, b, c, d)\) that satisfy the following condition:
\[
3^{r} \cdot 7^{s} = [a, b, c] = [a, b, d] = [a, c, d] = [b, c, d] \text{.}
\]

The notation \([x, y, z]\) denotes the least common multiple of \(x, y, z\).
(41st Putnam Mathematical Competition, 1980)
[Solution] Since 3 and 7 are prime numbers, each of \(a, b, c, d\) has the form \(3^{m} \cdot 7^{n}\), where \(m \in \{0,1,2, \cdots, r\}, \quad n \in \{0,1,2, \cdots, s\}\).

First, we prove that at least two of \(a, b, c, d\) have \(m=r\), and at least two have \(n=s\).
Otherwise, if at most one has \(m=r\), without loss of generality, let \(a=3^{r} \cdot 7^{n}\), and \(b, c, d\) have \(m < r\), then
\[
[b, c, d] \neq 3^{r} 7^{n}.
\]
This contradicts the given \([b, c, d]=3^{r} \cdot 7^{s}\).
Therefore, at least two have \(m=r\).
Similarly, at least two have \(n=s\).

Next, we find the number of tuples \((a, b, c, d)\) that satisfy the conditions.
If two of \((a, b, c, d)\) have the exponent of 3 as \(r\), and the other two have \(m \in \{0,1, 2, \cdots, r-1\}\), i.e., each has \(r\) choices, so there are \(C_{4}^{2} C_{r}^{1} C_{r}^{1}\) (ways).

If three of \((a, b, c, d)\) have the exponent of 3 as \(m=r\), then the other one has \(m\) chosen from \(\{0, 1, \cdots, r-1\}\) with \(r\) possibilities, so there are \(C_{4}^{3} C_{r}^{1}\) (ways).
If all four of \((a, b, c, d)\) have the exponent of 3 as \(m=r\), then there is only one possibility.
Thus, there are
\[
1 + C_{4}^{3} C_{r}^{1} + C_{4}^{2} C_{r}^{1} C_{r}^{1}
\]
ways to determine \(r\).
Similarly, there are
\[
1 + C_{4}^{3} C_{s}^{1} + C_{4}^{2} C_{s}^{1} C_{s}^{1}
\]
ways to determine \(s\).
Therefore, there are
\[
\left(1 + C_{4}^{3} C_{r}^{1} + C_{4}^{2} C_{r}^{1} C_{r}^{1}\right) \left(1 + C_{4}^{3} C_{s}^{1} + C_{4}^{2} C_{s}^{1} C_{s}^{1}\right)
\]
\[
= \left(1 + 4r + 6r^2\right) \left(1 + 4s + 6s^2\right)
\]
groups of ordered quadruples \((a, b, c, d)\) that satisfy the conditions.