≡
Modular Arithmetic
Congruences, Fermat's little theorem, Chinese remainder theorem, and number bases
Key Concepts
- Congruence a ≡ b (mod m) means m divides (a − b)
- You can add and multiply congruences term by term
- Fermat's little theorem simplifies large powers modulo a prime
- The Chinese Remainder Theorem combines congruences with coprime moduli
Important Formulae
| Fermat's little theorem | a^(p−1) ≡ 1 (mod p), p prime, gcd(a,p)=1 |
| Wilson's theorem | (p−1)! ≡ −1 (mod p) |
| Euler's theorem | a^φ(n) ≡ 1 (mod n), gcd(a,n)=1 |
Quick Tips
- For last-digit problems, work modulo 10.
- Reduce large exponents using Fermat's or Euler's theorem before computing.
Sample Practice Questions
-
The number of solutions to x² ≡ 1 (mod p) for odd prime p is:
Show answer
Answer: 2
-
Euler's theorem: if gcd(a, n) = 1, then a^φ(n) ≡ ? (mod n)
Show answer
Answer: 1
-
Convert 255 to hexadecimal.
Show answer
Answer: FF
-
The Chinese Remainder Theorem guarantees a unique solution modulo:
Show answer
Answer: lcm of the moduli (when moduli are pairwise coprime)
Practice Questions
Practise PRMO questions on Modular Arithmetic. Answers are revealed after each question.
Start Practice →Number Theory