16

How to find all positive integers $n$ such that $(n-1)!+1$ can be written as $n^k$ for some positive integer $k$?

Bill Dubuque
  • 272,048
  • 4
    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 – Jlamprong May 22 '14 at 08:00
  • 1
    Wilson's theorem is also what pops out in my head when I see this question. – user88595 May 22 '14 at 08:21
  • 1
    Also see https://math.stackexchange.com/questions/1195342/when-does-p-1-1-pk-hold?noredirect=1&lq=1 and https://math.stackexchange.com/questions/1315974/solving-a-little-diophantine-equationn-11-nm?noredirect=1&lq=1. – user26486 Aug 29 '17 at 19:48

1 Answers1

33

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}$.

Daniel Fischer
  • 206,697
Servaes
  • 63,261
  • 7
  • 75
  • 163
  • 1
    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$. – xskxzr May 22 '18 at 12:27
  • 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}$. – xskxzr May 22 '18 at 12:48