12.41 Find the positive integer solutions to the equation $n!+1=(m!-1)^{2}$.
(Recommended by the Soviet Ministry of Education, 1991)
[Solution] Clearly, when $m=1, m=2$, the given equation has no positive integer solutions.
Thus, we have
$$
m \geqslant 3 \text {. }
$$

The given equation can be rewritten as
$$
n!=m!(m!-2) .
$$

Therefore, $n>m$. From (1), we get
$$
n(n-1) \cdots(m+1)=m!-2 \text {. }
$$

Since $3 \mid m$, then
$$
3 \nmid m!-2 \text {. }
$$

Thus, the left side of (2) has no more than two factors; otherwise, if there were three factors, the product of three consecutive natural numbers would be divisible by 3.
So $n-m=1$ or $n-m=2$.
When $n-m=1$, $n=m+1$, we have

That is,
$$
\begin{array}{c}
m+1=m!-2, \\
m!=m+3,
\end{array}
$$
$$
m=3, \quad n=4 .
$$

When $n-m=2$, $n=m+2$, we have
$$
\begin{aligned}
& (m+2)(m+1)=m!-2, \\
m!= & (m+1)(m+2)+2 \leqslant 4 m(m-1) .
\end{aligned}
$$

Thus, $m \leqslant 4$.
But when $m=4, n=6$,
$$
6!+1=721 \neq(4!-1)^{2}=23^{2} \text {. }
$$

And when $m=3, \quad n=4$,
$$
4!+1=25=(3!-1)^{2} .
$$

Therefore, the given equation has only one set of positive integer solutions: $m=3, \quad n=4$.