Show that if $\displaystyle p$ is prime and $\displaystyle m \equiv n(mod p-1)$, then for any integer
$\displaystyle a$:
$\displaystyle a^{m} \equiv a^{n} (mod p)$
Use fermat's little theorem. Simply put, if m == n (mod (p - 1)), m - n = k(p - 1), for some integer k. Now, use both sides as powers of a, some number a. a^(k(p - 1)) can be written as (a^(p - 1))^k, where p is a prime.
Salahuddin
Maths online