Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Prove $(n -1) = (n-1)^{n}$ mod n

How would one go about doing this?

share|cite|improve this question
What if n = 4? 3^4 = 1 not 3 – quanta Apr 7 '11 at 14:00
why not just accept TonyK's answer? It is a valid/useful answer for the question as stated. Because other users have contributed content, I'm reluctant to delete the question. – Willie Wong Apr 7 '11 at 14:33
@willie, I have now done so, thanks. – Cavenaghi Apr 7 '11 at 14:40
up vote 6 down vote accepted

But this is just

$-1 = (-1)^n \mod n$

which is true if and only if $n$ is odd or $n = 2$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.