How to find all positive integers $n$ such that $(n-1)!+1$ can be written as $n^k$ for some positive integer $k$?
-
4$\begingroup$ If $n>4$ composite then $n|(n-1)!$ that implies $\gcd((n-1)!+1,n^k)=1$, so $n$ must be a prime. I guess it is related with Wilson's theorem $\endgroup$– JlamprongMay 22, 2014 at 8:00
-
1$\begingroup$ Wilson's theorem is also what pops out in my head when I see this question. $\endgroup$– user88595May 22, 2014 at 8:21
-
1$\begingroup$ Also see math.stackexchange.com/questions/1195342/… and math.stackexchange.com/questions/1315974/…. $\endgroup$– user26486Aug 29, 2017 at 19:48
1 Answer
For $n=2,3,5$ the number $(n-1)!+1$ is a perfect power of $n$, but not for $n=1$ or $n=4$.
Let $n>5$ be such that $(n-1)!+1$ is a perfect power of $n$. If $n$ is composite then $(n-1)!$ is divisible by $n$, so $(n-1)!+1$ cannot be a perfect power of $n$, so $n$ must be prime.
Let $p>5$ be a prime and suppose there exists $k\in\Bbb{Z}$ such that $(p-1)!+1=p^k$. Then $$(p-1)!=p^k-1=(p-1)\cdot\sum_{i=0}^{k-1}p^i,$$ which shows that $(p-2)!=\sum_{i=0}^{k-1}p^i$. We have $$(p-2)!\equiv\sum_{i=0}^{k-1}p^i\equiv k\pmod{p-1},$$ and because $p-1>4$ is composite we have $k\equiv(p-2)!\equiv0\pmod{p-1}$. The inequalities $$p^k-1=(p-1)!<(p-1)^{p-1}<p^{p-1},$$ of integers show that $k<p-1$, and clearly $k>0$, a contradiction.
Therefore $n=2,3,5$ are the only positive integers such that $(n-1)!+1=n^k$ for some $k\in\Bbb{Z}$.
-
1$\begingroup$ What is the use of $k'$. It seems you can get $0\equiv k\pmod{p-1}$ directly from $(p-2)!=\sum_{i=0}^{k-1}p^i$. $\endgroup$– xskxzrMay 22, 2018 at 12:27
-
$\begingroup$ In addition, it seems $(p-1)^{p-1}<p^{p-1}$ is needless. $k<p-1$ can be derived from $p^k-1<(p-1)^{p-1}$, but cannot from $p^k-1<p^{p-1}$. $\endgroup$– xskxzrMay 22, 2018 at 12:48