1

Find all natural numbers $n$ and $m$ for which $$n^m=(n-1)!+1.$$

By the Wilson theorem, $n$ is prime. Obviously, $m < n$.

For example, some solutions $(n, m)$ are $(2, 1)$, $(3, 1)$ and $(5, 2)$.

1 Answers1

5

You have found all the solutions.

Suppose there is a solution with $n>5.$ As you have noted, by Wilson's theorem, $n$ is prime. We have $$n^m-1=(n-1)!,$$ and dividing both sides by $n-1,$ $$(n-2)!=1+n+\cdots+n^{m-1}\tag{1}$$ Since $n>5$ is prime, $n-1$ is composite and $(n-1)|(n-2)!$ (Prove this.)

The preceding is Mindlack's hint, but I gather you haven't seen where to go from there.

Reducing both sides of $(1)$ modulo $n-1$ gives $0\equiv m\pmod{n-1}.$ Since $n-1$ divides $m$, we have $m\ge n-1.$

Now argue that $n^{n-1}>1+(n-1)!$

saulspatz
  • 53,131
  • Not getting how $1+n+\cdots +n^{m-1}\equiv m\pmod{n-1}$! Probably missing something trivial.. – tarit goswami Mar 29 '19 at 16:40
  • 1
    @tarit There are $m$ terms, each of which is congruent to $1$ mod $n-1$ – saulspatz Mar 29 '19 at 16:43
  • Oops. Nice solution, can you share how you think what is necessary while solving a particular problem?,e.g; this one – tarit goswami Mar 29 '19 at 16:52
  • @taritgoswami I wish I could. Actually, this problem appears in Tom Apostol's undergraduate Analytic Number Theory book. Many years ago, somebody showed me how to do it after I failed to solve it by myself. I was sure I'd found all the solutions, and that the exponent would be too big for there to be others. I think the key technique is to realize that you have to start by assuming $n$ is somewhat large, since we know there are some solutions. Examine closely how the argument uses $n>5.$ – saulspatz Mar 29 '19 at 17:01
  • Thanks for sharing :) – tarit goswami Mar 29 '19 at 17:41