On this page
"Find the remainder when 5^99 is divided by 13" looks like a calculator question. It isn't. Congruence rules, repeating cycles and Fermat's little theorem do all the work. Here are the rules, a four-step method and four JEE-style questions solved by hand, plus one to try.
What does a ≡ b (mod m) mean?
Two integers a and b are congruent modulo m when their difference a − b is a multiple of m, written a ≡ b (mod m) (modular arithmetic, Wikipedia). That is, a and b leave the same remainder on division by m. So 17 ≡ 2 (mod 5), and 7 ≡ 2 (mod 5).
Carl Friedrich Gauss developed the modern approach to number theory using modular arithmetic in Disquisitiones Arithmeticae, published in 1801 (same source). If a ≡ b and c ≡ d (mod m), then:
a + c ≡ b + d (mod m)
ac ≡ bd (mod m)
a^k ≡ b^k (mod m) for any non-negative integer k
The third rule lets you replace the base by its remainder before raising it to any power, so 7^2026 behaves like 2^2026 when you divide by 5. Remainders can also be negative: 25 ≡ −1 (mod 13), so even powers of 25 leave remainder 1.
What is Fermat's little theorem?
Fermat's little theorem states that if p is a prime and a is not divisible by p, then a^(p−1) ≡ 1 (mod p) (Fermat's little theorem, MathWorld). Pierre de Fermat stated it in a letter to Frénicle de Bessy dated 18 October 1640, without giving a proof (history of the theorem, Wikipedia).
Euler's totient theorem extends this to any modulus: if a is coprime to n, then a^φ(n) ≡ 1 (mod n) (Euler's totient theorem, MathWorld). φ(n) counts the numbers from 1 to n that share no factor other than 1 with n; for a prime p it is p − 1.
Once a power equals 1, the remainders repeat. Fermat guarantees a return to 1 by step p − 1, but it can come sooner: powers of 3 modulo 13 run 3, 9, 1, while powers of 2 need all 12 steps.
How do you find the remainder of a large power, step by step?
Reduce the base: replace a by its remainder modulo m, or a small negative number.
Find the cycle: compute a, a², a³ … modulo m until you reach 1 (or −1).
Reduce the exponent: keep its remainder on division by the cycle length.
Compute the small power left and write the answer between 0 and m − 1.
If base and divisor share a factor, neither theorem applies: split the divisor into coprime parts and combine (Question 4).
JEE-style questions, solved
These are written in JEE Main style, not taken from past papers.
Question 1. Remainder when 7^2026 is divided by 5. 7 ≡ 2 (mod 5). Powers of 2 modulo 5 run 2, 4, 3, 1: a cycle of 4. 2026 = 4 × 506 + 2, so 7^2026 ≡ 2² = 4. Remainder: 4.
Question 2. Remainder when 5^99 is divided by 13. 5² = 25 ≡ −1 (mod 13), so 5^4 ≡ 1. 99 = 4 × 24 + 3, so 5^99 ≡ 5³ = 125 = 9 × 13 + 8. Remainder: 8.
Question 3. Remainder when 2^2026 is divided by 9. 9 is not prime, so use Euler: 1, 2, 4, 5, 7 and 8 are coprime to 9, so φ(9) = 6 and 2^6 ≡ 1. 2026 = 6 × 337 + 4, so 2^2026 ≡ 2^4 = 16 ≡ 7. Remainder: 7.
Question 4. Remainder when 2^100 is divided by 12. 2 and 12 share a factor, so split 12 = 4 × 3. Modulo 4, 2^100 ≡ 0. Modulo 3, 2 ≡ −1, so the even power gives 1. The only number from 0 to 11 that is a multiple of 4 and leaves 1 on division by 3 is 4. Remainder: 4.
When the base sits next to a multiple of the divisor, the binomial theorem can be quicker; see our guide to remainder and divisibility problems with binomial expansion.
Where do students lose marks on remainder questions?
Reducing the exponent modulo p instead of modulo the cycle length (p − 1 for Fermat).
Using Fermat when the divisor is not prime, or Euler when base and divisor share a factor.
Leaving a negative answer such as −5 instead of converting it (−5 ≡ 8 mod 13).
If one of these keeps happening, bring a remainder question to the Fermi Problem Library: its step-by-step solver explains the reasoning rather than printing an answer, so you can see which step went wrong. To rebuild congruence from the start, the Fermi Concept Library gives each concept its own lesson. Olympiad-minded readers can go further with IOQM number theory questions on divisibility and modular patterns.



