18.5.1 * Find all positive integers $n>1$ that satisfy $(n-1)!+1=n^{2}$.

 untranslated portion:
将上面的文本翻译成英文，请保留源文本的换行和格式，直接输出翻译结果。 

This part is a note and not part of the original text to be translated, so it is excluded from the translation.
It is easy to verify that $n=5$ satisfies the equation $(n-1)!+1=n^{2}$. And $n=2,3,4$ do not satisfy this equation. When $n \geqslant 6$,
$$
(n-1)!+1>2(n-1)(n-2)=2\left(n^{2}-3 n+2\right)=n^{2}+n(n-6)+4>n^{2} \text {. }
$$

Therefore, $n=5$ is the only solution.