Exercise · ZW-FERMAT-PRIMALITY-TEST-005 · ★☆☆ Basic
If n is prime and gcd(a, n) = 1, what holds?
Choose one option.
Show answer
- A. \( a^{n-1} \equiv 1 \pmod{n} \)
Exercise · ZW-FERMAT-PRIMALITY-TEST-005 · ★☆☆ Basic
Choose one option.
This is the statement of Fermat's little theorem: for prime n and a coprime to n, the power n-1 leaves remainder 1.
The Fermat primality test is a probabilistic criterion for an integer \(n>1\): it declares \(n\) composite if, for some base \(a\) coprime to \(n\), the power \(a^{n-1}\) is not congruent to 1 modulo \(n\).
← ZW-FERMAT-PRIMALITY-TEST-004 ZW-FERMAT-PRIMALITY-TEST-006 →