# A proof involving Fermat's Little Theorem.

Let $p$ be a prime and n be an integer such that $p$ does not divide $n$. Suppose $d$ is the smallest natural number such that $n^d$ is congruent to $1 \mod p$. Prove that $d$ divides $(p-1)$.

So far, I've done: $n^{p-1}$ is congruent to $1 \mod p$. Moreover, $n^d$ is congruent to $n^{p-1} \mod p$. I'm not sure how to continue.

We can write $p-1=a\cdot d+r$ where $0\le r<d$ and $a,r$ are nonnegative integers
Now $n^d\equiv1\pmod p, n^{p-1}\equiv1\implies n^r\cdot(n^d)^a\equiv1\implies n^r\equiv1$
But $d$ is the smallest positive integer such that $\implies n^d\equiv1$
So, $r$ must be $0\implies p-1=?$
The multiplicative group of the field $Z_p$ is of order $p-1$, since $n$ is an element of that group its order is a divisor of the order of the group.