Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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 the following theorem:

Suppose $p$ is a prime number, $r$ and $s$ are positive integers and $x$ is an arbitrary integer.
Then we have $x^r \equiv x^s\bmod p$ whenever $r \equiv s \bmod (p-1)$.

share|cite|improve this question
up vote 2 down vote accepted

Let $r-s=k(p-1)$ where k is a non-negative integer (assume wlog that r>=s) Using Fermat's little theorem we know that $x^{p-1}=1$ (mod $p$) therefore $x^{k(p-1)}=1$ (mod $p$).

Thus, $x^{r-s}=1$ (mod p). Now multiply by $x^s$ to get: $x^r=x^s$ (mod p)

share|cite|improve this answer
Fermat's Last? Or little? – draks ... Nov 28 '12 at 12:51
little! Thank you – Amr Nov 28 '12 at 12:51

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.