4
$\begingroup$

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

$\endgroup$
5
  • 2
    $\begingroup$ I don't understand your question properly. $\endgroup$ Commented May 1, 2014 at 5:40
  • 3
    $\begingroup$ If $p$ divides $a$ then both $a^p$ and $a$ are congruent to $0$. $\endgroup$ Commented May 1, 2014 at 5:42
  • $\begingroup$ @AndréNicolas of course!!! thanks $\endgroup$ Commented May 1, 2014 at 5:43
  • $\begingroup$ 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. $\endgroup$ Commented May 1, 2014 at 5:44
  • $\begingroup$ @user42912: You are welcome. Sometimes "too easy" can be hard to see, we look for something fancy. $\endgroup$ Commented May 1, 2014 at 5:46

4 Answers 4

8
$\begingroup$

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

$\endgroup$
2
$\begingroup$

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

$\endgroup$
1
$\begingroup$

Following the comments of André Nicholas:

If $p\mid a$, 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$$

$\endgroup$
0
1
$\begingroup$

It is instructive to view this from a slightly more general perspective. The equivalence of the two common forms of the Little Fermat theorem is special case $\, f(x) = x^{p-1}-1\,$ below.

Theorem $\ $ If $\,p\,$ is prime and $f(x)$ is polynomial with integer coefficients then $$\begin{align} &p\mid x f(x)\ \text{ for all integers } x\\[.2em] \iff\ &p\mid f(x) \ \ \ \:\! \text{ for all integers } x\ \text{with } p\nmid x \end{align}\qquad\quad\ \ \ $$

Proof $\ (\Rightarrow)\ $ By hypothesis $\,p\mid xf(x),\,$ so $\,p\nmid x\Rightarrow\,p\mid f(x)\,$ by Euclid's Lemma.

$(\Leftarrow)\ $ We split into two cases depending on whether or not $\,p\mid x$.

Case $(1)\ \ p\mid x,$ so $\,p\mid xf(x).$

Case $(2)\ \ p\nmid x,\,$ so by hypothesis $\,p\mid f(x)\,$ so $\,p\mid xf(x).\ $ $\small\bf QED$

Remark $ $ If modular arithmetic or finite fields are familiar then it can be viewed more arithmetically in the following form over $\color{#c00}{\Bbb Z_p}$ (or any integral ${\rm\color{#c00}{domain}}\, \color{#c00}R\:\!)$

$$\begin{align} \forall x\!:&\ \ \ \ \ \ \ xf(x)= 0\\[.2em] \iff\ \forall x\ &\ [\:\!x\not= 0\Rightarrow f(x)= 0\:\!]\\[.6em] {\rm generally}\quad \forall x\!:&\ \ \ \ \ \ g(x)\:\!f(x)= 0\\[.2em] \iff \ \forall x\ &\ [\:\!g(x)= 0\ \ \color{#c00}{\rm or}\ \ f(x)= 0\:\!]\ \ \text{by $\,\color{#c00}R\,\ {\rm a}\ \color{#c00}{\rm domain}$}\\[.2em] \iff\ \forall x\ &\ [\:\!g(x)\not= 0\,\Rightarrow\:\! f(x)= 0\:\!]\end{align}$$

$\endgroup$
1
  • $\begingroup$ Answer migrated from a deleted question, to help with a recent question. $\endgroup$ Commented May 8, 2022 at 11:54

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.