mathlesstraveled.com
Making the Fermat primality test deterministic
Let’s recall Fermat’s Little Theorem: If $latex p$ is prime and $latex a$ is an integer where $latex 0 < a < p$, then $latex a^{p-1} \equiv 1 \pmod p$. Recall that we can turn this directly i…