An integer is selected at random in the range . What is the probability that the remainder when is divided by is ?
- A)
- B)
- C)
- D)
- E)
Answer
D
Key insight
Fourth powers of 1, 2, 3, 4 are all 1 mod 5, so N^16 is 1 mod 5 exactly when 5 does not divide N.
Solution
Only the remainder of mod matters. Compute fourth powers of each nonzero residue:
So whenever , . If , then .
Thus leaves remainder exactly when is not a multiple of . Since , the range to contains multiples of and non-multiples. The probability is
The answer is .
Why this works
This is Fermat's little theorem in disguise: for a prime and , . Even without knowing the theorem, checking the four nonzero residues takes seconds. The exponent is a multiple of , which is the only reason it looks scary. Because is divisible by , the residues are perfectly balanced and the probability is a clean .
The trap
Testing only N = 1, 2 and concluding the remainder depends on N in a complicated way, or forgetting that multiples of 5 give remainder 0.
Common mistakes
- Testing only N = 1, 2 and concluding the remainder depends on N in a complicated way, or forgetting that multiples of 5 give remainder 0.
- Answering (choice E) after checking a few non-multiples of and never trying .
Techniques
Compute small cases, spot the pattern, generalize