Exercise · ZW-FERMAT-PRIMALITY-TEST-004 · ★☆☆ Basic
What condition must the base a satisfy in the Fermat test?
Choose one option.
Show answer
- B. gcd(a, n) = 1
Exercise · ZW-FERMAT-PRIMALITY-TEST-004 · ★☆☆ Basic
Choose one option.
To apply Fermat's little theorem, a must be coprime to n; otherwise the test does not apply.
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-003 ZW-FERMAT-PRIMALITY-TEST-005 →