I am reading a paper and they write that Fermat derived his little theorem from this observation: If $p$ is a prime, and $a$ is any number not divisible by $p$, then the order of a modulo $p$ divides $p−1$. In terms of divisiblity and this is the theorem that Fermat found the theorem looks like this:
If $p$ is prime and $a$ is coprime to p, then $p$ divides $a^{p−1}−1\implies p \mid a^{p-1}-1$
The multiplicative order in terms of divisibility looks like this: the order of $a$ mod $p$ is the smallest $e > 0$ so that $p$ divides $a^e−1\implies p \mid a^{e}-1$
I am trying to obtain Fermat's theorem by having a look on his observation: So I want to show that: "If $p$ is a prime, and $a$ is any number not divisible by $p$, then the order of a modulo $p$ divides $p−1$" leads to "If $p$ is prime and $a$ is coprime to p, then $p$ divides $a^{p−1}−1$".
My approach is, taking the definition of order: p | $a^e-1$ and using the observation $=>$p | $a^{e|p-1}-1$. This already looks pretty similar to $ p $ | $a^{p-1}-1$, but not quite and I am not sure if I am on the right track.
Thanks for your help