Questions: Fermat's Little Theorem

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

You need to compute 3^100 (mod 7). Using Fermat's Little Theorem, the most efficient approach is...

ACompute 3^100 directly by repeated squaring, then reduce mod 7 at the end
BUse 3^6 ≡ 1 (mod 7), write 100 = 16×6 + 4, so 3^100 ≡ 3^4 = 81 ≡ 4 (mod 7)
CApply the corollary 3^7 ≡ 3 (mod 7) and write 100 as a multiple of 7 to reduce
DReduce the base: since 3 < 7, conclude 3^100 ≡ 1 (mod 7) by the theorem
Question 2 Multiple Choice

A primality test checks whether n = 561 satisfies a^560 ≡ 1 (mod 561) for several randomly chosen values of a coprime to 561. Every test passes. Can we conclude 561 is prime?

AYes — if a^(n−1) ≡ 1 (mod n) holds for multiple bases, n must be prime by Fermat's theorem
BNo — 561 = 3×11×17 is a Carmichael number, and Carmichael numbers satisfy a^(n−1) ≡ 1 (mod n) for all a coprime to n, even though they are composite
CYes, but only if we test at least p−1 different bases
DNo — but only because we should test a = 2 specifically; any other base gives false positives
Question 3 True / False

If p is prime and a is divisible by p, then a^(p−1) ≡ 1 (mod p).

TTrue
FFalse
Question 4 True / False

For any prime p and any integer a (whether or not a is divisible by p), it is true that a^p ≡ a (mod p).

TTrue
FFalse
Question 5 Short Answer

Why does passing the Fermat primality test — even for many different base values — not guarantee that n is prime?

Think about your answer, then reveal below.