Find all triples \((a,b,p)\) of positive integers with \(p\) prime and \(a^p=b!+p\).
Let \(a=p, b>p\) and \(p \geqslant 5\) (the remaining cases are dealt with as in solution \(3\)). Modulo \((p+1)^{2}\) it holds that
\(p^{p}-p=(p+1-1)^{p}-p \equiv\binom{p}{1}(p+1)(-1)^{p-1}+(-1)^{p}-p=p(p+1)-1-p=p^{2}-1 \not \equiv 0 \bmod \left((p+1)^{2}\right)\).
Since \(p \geqslant 5\), the numbers 2 and \(\frac{p+1}{2}\) are distinct and less than or equal to \(p\). Therefore, \(p+1 \mid p!\), and so \((p+1)^{2} \mid(p+1)!\).
But \(b \geqslant p+1\), so \(b!\equiv 0 \not \equiv p^{p}-p \bmod (p+1)^{2}\), a contradiction.