Four. (50 points) Let $p$ be a prime number, $n$ be a positive integer, and
$$
n=n_{0}+n_{1} p+\cdots+n_{t} p^{t} \text {, }
$$

where $n_{i} \in \mathbf{N}, 0 \leqslant n_{i} \leqslant p-1, i=0,1, \cdots, t$.
Let $S_{n}$ denote the set of ordered triples $(a, b, c)$ that satisfy the following conditions:
(1) $a, b, c \in \mathbf{N}$;
(2) $a+b+c=n$;
(3) $p \times \frac{n!}{a!\cdot b!\cdot c!}$.
Question: How many ordered triples $(a, b, c)$ are there in the set $S_{n}$?
Let $p$ be a prime, $n \in \mathbf{N}_{+}$.
If $p^{\alpha} \operatorname{In}$, but $p^{\alpha+1} \chi_{n}$, then we denote $v_{p}(n)=\alpha$. Therefore,
$$
v_{p}(n!)=\sum_{k=1}^{+\infty}\left[\frac{n}{p^{k}}\right],
$$

where $[x]$ represents the greatest integer not exceeding the real number $x$.
If $n=n_{0}+n_{1} p+\cdots+n_{1} p^{\prime}$, where,
$$
0 \leqslant n_{i} \leqslant p-1,0 \leqslant i \leqslant t,
$$

then $v_{p}(n!)=\frac{n-\left(n_{0}+n_{1}+\cdots+n_{t}\right)}{p-1}$.
Without loss of generality, let
$$
\left\{\begin{array}{l}
n=n_{0}+n_{1} p+\cdots+n_{1} p^{t}\left(0 \leqslant n_{i} \leqslant p-1\right), \\
a=a_{0}+a_{1} p+\cdots+a_{1} p^{t}\left(0 \leqslant a_{i} \leqslant p-1\right), \\
b=b_{0}+b_{1} p+\cdots+b_{1} p^{t}\left(0 \leqslant b_{i} \leqslant p-1\right), \\
c=c_{0}+c_{1} p+\cdots+c_{1} p^{t}\left(0 \leqslant c_{i} \leqslant p-1\right),
\end{array}\right.
$$

where $n=a+b+c$.
Then $p \times \frac{n!}{a!\cdot b!\cdot c!}$ is an integer if and only if
$$
v_{p}(n!)=v_{p}(a!)+v_{p}(b!)+v_{p}(c!) .
$$

By equation (1), $p \times \frac{n!}{a!\cdot b!\cdot c!}$ is an integer if and only if
$$
\sum_{i=0}^{1} n_{i}=\sum_{i=0}^{1}\left(a_{i}+b_{i}+c_{i}\right) \text {, }
$$

which means that the sum of the digits of $a, b, c$ in base $p$ equals the sum of the digits of their sum $n$, if and only if there is no carry when adding $a, b, c$ (in base $p$), i.e., if and only if
$$
n_{i}=a_{i}+b_{i}+c_{i}(0 \leqslant i \leqslant t) .
$$

The number of non-negative integer solutions to the equation $x+y+z=m$ is $\mathrm{C}_{m+2}^{2}$. Therefore, the number of ordered triples $(a, b, c)$ that satisfy the condition is
$$
\left|S_{n}\right|=\mathrm{C}_{n_{0}+2}^{2} \mathrm{C}_{n_{1}+2}^{2} \cdots \mathrm{C}_{n_{1}+2}^{2} .
$$
(Provided by Wu Zhongpi)