Exercise · ZW-FERMAT-PRIMALITY-TEST-007 · ★★☆ Intermediate

Use the test with base 2 for n = 9. What do you conclude?

Choose one option.

Show answer
  • C. 9 is composite, because \( 2^8 \equiv 4 \pmod{9} \)

Explanation

We have \( 2^8 = 256 = 28\cdot 9 + 4 \), so the remainder is 4 rather than 1; the congruence fails and 9 is composite.

Study Elementary number theory in ZWMath →

Review the concept: Fermat primality test

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\).

\[a^{n-1} \equiv 1 \pmod{n}\]

More practice problems: fermat primality test

← ZW-FERMAT-PRIMALITY-TEST-006 ZW-FERMAT-PRIMALITY-TEST-008 →