0

Prove that $a^x\equiv a^{x\bmod(m-1)}\pmod m$ for m prime:

I attempted to prove the cyclicity using Fermat's little theorem, that $a^p\equiv a\pmod{p} $ but didn't succeed. Could you please explain to me how to prove it?

Bill Dubuque
  • 272,048

2 Answers2

1

$a^{p}\equiv a$ is the weak form of Fermat's Little Theorem.

Far stronger and much more relevant is the strong form that if $p\not \mid a$ then $a^{p-1} \equiv 1 \pmod p$.

And with that in mind the proof is immediate, isn't it?

$x \equiv y \pmod {p-1}$ if and only if $y = x + k(p-1)$ for some integer $k$ and so $a^y =a^{x + k(p-1)} = a^x \cdot a^{k(p-1)} \equiv a^x \cdot 1^k\equiv ax \pmod{p-1}$

Nit picking fine print:


That is to say if $p\not \mid a$.

If $p\mid a$ then $a^{anything} \equiv 0\pmod p$ so $a^x \equiv a^y$ whether or not $y\equiv x \pmod{p-1}$. .... Oh but $a^0 = 1$,.... so I should say $a^{anything\ but\ 0}\equiv 0 \pmod p$.

Oh, I guess there is an exception. If $p\mid a$ then $a\equiv 0\pmod p$ but $a^0 =1 \equiv pmod p$. So we don't have $a^0 \equiv a^y \pmod p$ for any $y \ne 0$, even if $y \equiv 0 \pmod{p-1}$.

fleablood
  • 124,253
1

By Fermat's little theorem, $a^{p-1}\equiv 1\bmod p$, when $(a,p)=1$. This means we can reduce the exponent $\bmod p-1$ in this case. On the other hand when $a$ is a multiple of $p$, both sides are zero (or you get $0^0$ which is undefined).