Take the 2-minute tour ×
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.

I know that if $p$ prime and $p\nmid a$, then $a^{p-1}\equiv 1\pmod p$ and I know also that $a^{p}\equiv a \pmod p$ using the fact $a\equiv a \pmod p$ and multiplying the members.

What I couldn't understand is why in the Fermat little theorem we have $a^{p}\equiv a \pmod p$ for all integer $a$.

share|improve this question
2  
I don't understand your question properly. –  rah4927 May 1 at 5:40
2  
If $p$ divides $a$ then both $a^p$ and $a$ are congruent to $0$. –  André Nicolas May 1 at 5:42
    
@AndréNicolas of course!!! thanks –  user42912 May 1 at 5:43
    
You already know the result for coprime p and a. If $p|a$ , $a^p\equiv 0\pmod p$ and since $0\equiv a\pmod p$, and the claim follows. –  rah4927 May 1 at 5:44
    
@user42912: You are welcome. Sometimes "too easy" can be hard to see, we look for something fancy. –  André Nicolas May 1 at 5:46

3 Answers 3

If $p$ divides $a$ then both $a^p$ and $a$ are congruent to $0$, so $a^p\equiv a\pmod{p}$ holds trivially.

Remark: From $a^p\equiv a\pmod{p}$, we can conversely derive the more common form of Fermat's Theorem. For if $a^p\equiv a\pmod p$, then $p$ divides $a(a^{p-1}-1)$. So if $p$ does not divide $a$, then $p$ divides $a^{p-1}-1$.

share|improve this answer

Either $p$ divides $a$ or $p\nmid a$

As $p$ is prime $p\nmid a\implies (a,p)=1$

As $\displaystyle a^p-a=a(a^{p-1}-1)$

This will be divisible by $p$ if $p|a$

otherwise it will also be divisible by $p$ as $p|(a^{p-1}-1)$ by Fermat little theorem

share|improve this answer
up vote 1 down vote accepted

Following the comments of André Nicholas:

If $a\mid p$, then $a\equiv 0 \pmod p$, then multiplying $p$ times both sides we have $a^p\equiv 0 \pmod p$. Thus we have $a\equiv 0 \pmod p$ and $0\equiv a^p\pmod p$ by symmetry, then finally by transitivity:

$$a\equiv a^p \pmod p$$

share|improve this answer
    
I suppose you meant to say $ p\mid a$ in the second line? –  awllower Nov 11 at 14:08

Your Answer

 
discard

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.