Sub topic 15
Choosing a Method Under Exam Time Pressure
Assumed model
This chapter assumes that you can divide integers, identify prime factors, use exponent rules, and apply basic divisibility tests. You should also know that a remainder is always between 0 and one less than the divisor.
A remainder question asks for the value left after division. Modular notation gives a compact way to write this:
a ≡ b (mod n)
means that a and b have the same remainder when divided by n. For example, 23 ≡ 2 (mod 7).
Under CAT time pressure, the main skill is choosing the shortest valid route. Do not start with a powerful theorem when a small cycle or divisibility rule solves the question directly.
The decision process
Use this order:
- Identify the modulus, which is the number after “divided by” or “remainder upon division by.”
- Reduce the base or each term before doing large calculations.
- Look for a short cycle in powers.
- Check whether a divisibility rule or algebraic identity is faster.
- Use Fermat's theorem, Euler's theorem, Wilson's theorem, or CRT only when the structure clearly supports it.
- Check that the final remainder lies between
0andn - 1.
| Question pattern | Best first method | Typical first move |
|---|---|---|
| A sum, difference, or product | Reduce each term | Replace each number by its remainder |
| A small power such as `7^100 mod 10` | Find a cycle | List the first few powers |
| Last digit or last two digits | Use modulus `10` or `100` | Find the repeating pattern |
| Divisibility by 2, 3, 4, 5, 8, 9, or 11 | Divisibility rule | Inspect the relevant digits |
| Prime modulus and base not divisible by it | Fermat's little theorem | Reduce the exponent modulo `p - 1` |
| Composite modulus with coprime base | Euler's theorem | Reduce the exponent modulo `φ(n)` |
| Factorial modulo a prime | Wilson's theorem or cancellation | Use `(p - 1)! ≡ -1 (mod p)` |
| Several remainder conditions | Successive substitution or CRT | Combine the easiest condition first |
Worked choices
To find 7^100 mod 10, list the last digits:
7, 9, 3, 1
The cycle has length 4. Since 100 is divisible by 4, the answer is the fourth value, 1.
print([pow(7, k, 10) for k in range(1, 5)])
print(pow(7, 100, 10))For 2^100 mod 13, the modulus is prime, so Fermat's little theorem is efficient:
2^12 ≡ 1 (mod 13)
Therefore, reduce 100 modulo 12. The remainder is 4, so:
2^100 ≡ 2^4 ≡ 16 ≡ 3 (mod 13)
For a condition such as
x ≡ 2 (mod 3) and x ≡ 3 (mod 5),
successive substitution is usually faster than writing the full Chinese Remainder Theorem. Numbers that are 3 modulo 5 are 3, 8, 13, 18, 23. Of these, 23 is 2 modulo 3. Thus the smallest solution is 23.
Common errors
- Using Fermat's theorem when the modulus is not prime.
- Forgetting that the base must be coprime to the modulus for Euler's theorem.
- Treating a cycle length as the answer instead of using the exponent's position in the cycle.
- Reporting a negative remainder when the question expects the standard remainder.
- Applying a divisibility rule to the wrong modulus. For example, the rule for 4 uses the last two digits, while the rule for 8 uses the last three.
Exercise
Find the remainder when 3^50 is divided by 10. Which method is fastest?
Show answer
The last digits cycle as 3, 9, 7, 1, with length 4. Since 50 leaves remainder 2 upon division by 4, the answer is the second value, 9.