When is $(p-2)!-1$ power of $p$ if $p$ is prime?

957 Views Asked by At

If $p$ is prime, for what values of $p$ is $(p-2)!-1$ a power of $p$? I know how to solve that when $p<5$ then $(p-1)!+1$ can be written as power of $p$.

1

There are 1 best solutions below

0
On BEST ANSWER

More generally: if $n\in\mathbb Z_{\ge 2}$, $k\in\mathbb Z_{\ge 0}$:

then all the solutions of $(n-2)!-1=n^k$ are $(n,k)=(4,0),(5,1)$.

Checking $n\in\{2,3,4,5\}$ gives those solutions. Let $n\ge 6$; then $k\ge 1$.

Clearly $n$ is odd; also $2<\frac{n-1}{2}\le n-2$, so $n-1\mid (n-2)!=n^k+1$.

But also $n-1\mid n^k-1=(n-1)\left(n^{k-1}+n^{k-2}+\cdots+1\right)$.

Therefore $n-1\mid \left(n^k+1\right)-\left(n^k-1\right)=2$, so $n-1\le 2$, contradiction.