Name of the theorem used for testing the primality of a number

48 Views Asked by At

$n$ is prime $\iff$ $a^{n-1} \equiv 1 \mod n \hspace{10mm} \forall 1 \le a \le n-1$

What is the name of this theorem in literature?

1

There are 1 best solutions below

5
On

$\Longrightarrow$ is Fermat's little theorem

$\Longleftarrow$ is the definition of prime: any $a<n$ is coprime to $n$, and therefore $n$ must be prime.