∑ MockTestKart
⌂

0 0 0
Complete Formula Lesson

Remainders: Complete Formula Lesson

Master remainder problems using the division algorithm, modular arithmetic, cyclicity of powers, and the Chinese Remainder Theorem. This lesson provides derivations, worked examples, shortcuts, and common traps to solve any remainder question confidently.

On this page
  1. The Division Algorithm: Foundation
  2. Modular Arithmetic: Notation and Properties
  3. Cyclicity of Remainders for Powers
  4. Chinese Remainder Theorem (CRT) for Simultaneous Congruences
  5. Fermat's Little Theorem and Euler's Theorem
  6. Shortcuts and Mental Math Techniques
  7. Common Traps and How to Avoid Them
  8. Applications and When to Use Each Method
  9. Worked examples
  10. Common mistakes
  11. Frequently asked questions

Remainders are the leftovers after division. They appear in number theory, competitive exams, and real-life scheduling. This lesson builds from the basic division algorithm to advanced techniques for powers and simultaneous congruences. You will learn to compute remainders quickly and avoid typical errors.

Key Remainder Formulas
Division Algorithma = nq + r, 0 ≤ r < n
Modular Congruencea ≡ b (mod n) ⇔ n | (a - b)
Power ReductionIf gcd(a,n)=1 and a^L ≡ 1 (mod n), then a^k ≡ a^(k mod L) (mod n)
Fermat's Little Theorema^{p-1} ≡ 1 (mod p) for prime p, gcd(a,p)=1
Euler's Theorema^{φ(n)} ≡ 1 (mod n) if gcd(a,n)=1
CRT for Two CongruencesIf gcd(m,n)=1: x ≡ a (mod m), x ≡ b (mod n) ⇒ x ≡ a + m * ((b - a) * m^{-1} mod n) (mod mn)
MethodWhen to UseExample
Division AlgorithmBasic remainder problems27 ÷ 7 = 3 remainder 6
Modular ArithmeticSimplifying expressions27 ≡ 6 (mod 7)
CyclicityPowers with small modulus2^100 mod 5: cycle length 4, 100 mod 4=0 ⇒ 1
Fermat/EulerLarge exponents, prime/coprime modulus27^27 mod 7: 27≡-1, (-1)^27=-1≡6
CRTSimultaneous congruencesx≡5 mod7, x≡3 mod11 ⇒ x=47
1Identify the type of remainder problem.
2If basic division, apply a = nq + r.
3If power, reduce base modulo n, then find cycle length or use Fermat/Euler.
4If simultaneous congruences, use CRT.
5Always verify with a small case or alternate method.

The Division Algorithm: Foundation

For any integer a and positive integer n, there exist unique integers q (quotient) and r (remainder) such that a = nq + r, where 0 ≤ r < n. Here, a is the dividend, n is the divisor, q is the quotient, and r is the remainder. This formula is the bedrock of all remainder problems. It tells us that the remainder is always non-negative and less than the divisor. For example, when 27 is divided by 7, we write 27 = 7×3 + 6, so remainder is 6. The condition 0 ≤ r < n is crucial; if you get a negative remainder, add the divisor to make it non-negative. This formula also allows us to express any number in terms of its divisor and remainder, which is useful for solving congruences.

  • a = nq + r, with 0 ≤ r < n.
  • r is unique for given a and n.
  • Negative remainders can be converted: if r < 0, then r + n is the true remainder.
  • For positive a, the quotient q = floor(a/n); for negative a, adjust q so that 0 ≤ r < n.
a = nq + r, 0 ≤ r < n

Modular Arithmetic: Notation and Properties

Modular arithmetic uses the notation a ≡ b (mod n) to mean a and b leave the same remainder when divided by n. Equivalently, n divides (a - b). This notation simplifies remainder calculations because we can replace numbers with their remainders. Key properties: if a ≡ b (mod n) and c ≡ d (mod n), then a+c ≡ b+d (mod n), a-c ≡ b-d (mod n), and a×c ≡ b×d (mod n). Also, if a ≡ b (mod n), then a^k ≡ b^k (mod n) for any positive integer k. These properties allow us to reduce large numbers before computing remainders. For example, to find 27^27 mod 7, we first reduce 27 mod 7: 27 ≡ 6 (mod 7), so 27^27 ≡ 6^27 (mod 7). Then we can use cyclicity.

  • a ≡ b (mod n) means n | (a - b).
  • Addition, subtraction, multiplication preserve congruence.
  • Powers preserve congruence: a ≡ b ⇒ a^k ≡ b^k (mod n).
  • Division is not always valid; only if gcd(divisor, n)=1.
a ≡ b (mod n) ⇔ n | (a - b)

Cyclicity of Remainders for Powers

When computing a^k mod n, the remainders of a^1, a^2, a^3, ... often repeat in a cycle. The length of this cycle is called the period or order. For example, powers of 2 modulo 5: 2^1≡2, 2^2≡4, 2^3≡3, 2^4≡1, 2^5≡2, so the cycle length is 4. To find a^k mod n, reduce k modulo the cycle length. If the cycle length is L, then a^k ≡ a^(k mod L) (mod n), with the convention that if k mod L = 0, use a^L. This method works when a and n are coprime, but often works even if not, after the first few terms. For 2^100 mod 5, cycle length 4, 100 mod 4 = 0, so remainder is 2^4 mod 5 = 1. For 3^91 mod 5: 3^1≡3, 3^2≡4, 3^3≡2, 3^4≡1, cycle length 4, 91 mod 4 = 3, so remainder is 3^3 mod 5 = 27 mod 5 = 2. Verify: 3^4≡1, so 3^88≡1, and 3^91 = 3^88·3^3 ≡ 1·27 ≡ 2 (mod 5).

  • Find cycle length L by computing powers until 1 appears (for coprime a,n).
  • Reduce exponent modulo L; if remainder 0, use L.
  • For non-coprime, cycle may start after some terms.
  • Always verify with small exponents.
If gcd(a,n)=1 and a^L ≡ 1 (mod n), then a^k ≡ a^(k mod L) (mod n), with k mod L = 0 ⇒ a^L.

Chinese Remainder Theorem (CRT) for Simultaneous Congruences

When a number x satisfies multiple congruences with pairwise coprime moduli, CRT gives a unique solution modulo the product. For two congruences: x ≡ a (mod m) and x ≡ b (mod n), with gcd(m,n)=1, the solution is x ≡ a + m * t (mod mn), where t ≡ (b - a) * m^{-1} (mod n). Here m^{-1} is the modular inverse of m modulo n. For example, x ≡ 5 (mod 7) and x ≡ 3 (mod 11). m=7, n=11. m^{-1} mod 11: 7*8=56≡1 mod 11, so inverse is 8. t ≡ (3-5)*8 = -2*8 = -16 ≡ -5 ≡ 6 mod 11. Then x ≡ 5 + 7*6 = 47 mod 77. So smallest positive is 47. This method generalizes to more congruences. CRT is powerful for problems like 'find the smallest number that leaves remainders...'.

  • Requires moduli pairwise coprime.
  • Solution unique modulo product of moduli.
  • Use modular inverse to find parameter t.
  • For more than two, solve iteratively.
If gcd(m,n)=1: x ≡ a (mod m), x ≡ b (mod n) ⇒ x ≡ a + m * ((b - a) * m^{-1} mod n) (mod mn)

Fermat's Little Theorem and Euler's Theorem

Fermat's Little Theorem: If p is prime and gcd(a,p)=1, then a^{p-1} ≡ 1 (mod p). This is a special case of Euler's Theorem: If gcd(a,n)=1, then a^{φ(n)} ≡ 1 (mod n), where φ(n) is Euler's totient function. These theorems provide the cycle length directly. For example, modulo 7 (prime), for any a not divisible by 7, a^6 ≡ 1 (mod 7). So to compute 27^27 mod 7, reduce base: 27≡6 mod 7. Then 6^6≡1, so 6^27 = 6^{6*4+3} ≡ (6^6)^4 * 6^3 ≡ 1 * 216 ≡ 216 mod 7. 216 = 7*30 + 6, so remainder 6. This matches the given answer. Euler's theorem is useful when modulus is composite but coprime to base.

  • Fermat: a^{p-1} ≡ 1 (mod p) for prime p, a not multiple of p.
  • Euler: a^{φ(n)} ≡ 1 (mod n) if gcd(a,n)=1.
  • φ(n) for n = p^k is p^k - p^{k-1}.
  • These give the cycle length, simplifying exponent reduction.
a^{φ(n)} ≡ 1 (mod n) if gcd(a,n)=1

Shortcuts and Mental Math Techniques

For quick calculations, use these tricks: 1) Reduce base modulo divisor first. 2) For powers, find cycle length by computing successive remainders until repetition. 3) Use negative remainders: if a ≡ -1 (mod n), then a^k ≡ (-1)^k (mod n). 4) For numbers like 10^k mod 9, note 10 ≡ 1, so remainder is 1. 5) For divisibility by 3 or 9, sum digits. 6) For modulo 11, alternating sum. 7) When divisor is small, list remainders. 8) Use CRT for simultaneous congruences. Practice these to speed up.

  • Reduce base before exponentiating.
  • Use negative remainders to simplify: e.g., 27 ≡ -1 mod 7? 27 mod 7 = 6 ≡ -1, so 27^27 ≡ (-1)^27 = -1 ≡ 6 mod 7.
  • For modulo 5, last digit determines remainder.
  • For modulo 2, parity.
  • For modulo 4, last two digits.
If a ≡ -1 (mod n), then a^k ≡ (-1)^k (mod n)

Common Traps and How to Avoid Them

Trap 1: Forgetting that remainder must be non-negative. Always convert negative remainders by adding divisor. Trap 2: Assuming you can divide in modular arithmetic without checking coprimality. Trap 3: Using cycle length incorrectly when base and modulus are not coprime. Trap 4: Misapplying CRT when moduli are not coprime. Trap 5: Reducing exponent modulo wrong number (should be cycle length, not modulus). Trap 6: Confusing quotient and remainder. Trap 7: Not verifying with small cases. Always double-check with a simple example or alternate method.

  • Remainder r must satisfy 0 ≤ r < n.
  • Division in modular arithmetic requires modular inverse.
  • Cycle length may not start at exponent 1 if gcd(a,n)>1.
  • CRT requires pairwise coprime moduli.
  • Exponent reduction uses cycle length, not modulus.
If r < 0, then true remainder = r + n

Applications and When to Use Each Method

Use the division algorithm for basic remainder problems. Use modular arithmetic for simplifying expressions. Use cyclicity for powers when modulus is small or when you can find a short cycle. Use Fermat/Euler for large exponents with prime or coprime modulus. Use CRT for simultaneous congruences. For problems like 'remainder when square of a number is divided', use modular arithmetic: if x ≡ 3 (mod 5), then x^2 ≡ 9 ≡ 4 (mod 5). For 'smallest number satisfying remainders', use CRT. Always identify the structure: is it a power? simultaneous? Then choose the appropriate tool.

  • Basic division: a = nq + r.
  • Power: use cyclicity or Fermat/Euler.
  • Simultaneous: use CRT.
  • Square/cube: use modular arithmetic properties.
  • Large numbers: reduce base first.
x ≡ a (mod n) ⇒ x^k ≡ a^k (mod n)

Worked examples

What is the remainder when 27^27 is divided by 7?
Show solution

1) Reduce base: 27 mod 7 = 6 ≡ -1 (mod 7). 2) So 27^27 ≡ (-1)^27 = -1 ≡ 6 (mod 7). 3) Remainder is 6.

6
What is the remainder when 2^100 is divided by 5?
Show solution

1) Find cycle of 2 mod 5: 2^1=2, 2^2=4, 2^3=8≡3, 2^4=16≡1, cycle length 4. 2) 100 mod 4 = 0, so use 2^4 ≡ 1. 3) Remainder is 1.

1
What is the remainder when 7^85 is divided by 6?
Show solution

1) 7 ≡ 1 (mod 6). 2) So 7^85 ≡ 1^85 = 1 (mod 6). 3) Remainder is 1.

1
A number when divided by 7 leaves remainder 5, and when divided by 11 leaves remainder 3. What is the smallest such number?
Show solution

1) Let x ≡ 5 (mod 7) and x ≡ 3 (mod 11). 2) x = 7k + 5. 3) Substitute: 7k + 5 ≡ 3 (mod 11) ⇒ 7k ≡ -2 ≡ 9 (mod 11). 4) Inverse of 7 mod 11 is 8 (since 7*8=56≡1). 5) k ≡ 9*8 = 72 ≡ 6 (mod 11). 6) Smallest k=6 gives x=7*6+5=47. 7) Check: 47 mod 7 = 5, 47 mod 11 = 3. So answer 47.

47
A number when divided by 7 leaves remainder 5, and when divided by 9 leaves remainder 7. What is the smallest such number?
Show solution

1) x ≡ 5 (mod 7), x ≡ 7 (mod 9). 2) x = 7k + 5. 3) 7k + 5 ≡ 7 (mod 9) ⇒ 7k ≡ 2 (mod 9). 4) Inverse of 7 mod 9 is 4 (7*4=28≡1). 5) k ≡ 2*4=8 (mod 9). 6) Smallest k=8 gives x=7*8+5=61. 7) Check: 61 mod 7 = 5, 61 mod 9 = 7. So answer 61.

61
A number when divided by 5 leaves a remainder of 3. What is the remainder when the square of the same number is divided by 5?
Show solution

1) Let number be n ≡ 3 (mod 5). 2) Then n^2 ≡ 3^2 = 9 ≡ 4 (mod 5). 3) Remainder is 4.

4
What is the remainder when 3^91 is divided by 5?
Show solution

1) Find cycle of 3 mod 5: 3^1=3, 3^2=9≡4, 3^3=27≡2, 3^4=81≡1, cycle length 4. 2) 91 mod 4 = 3, so 3^91 ≡ 3^3 = 27 ≡ 2 (mod 5). 3) Remainder is 2.

2

Common mistakes

  • Forgetting that remainder must be non-negative; e.g., -1 mod 7 is 6, not -1.
  • Reducing exponent modulo the modulus instead of the cycle length.
  • Assuming a^0 ≡ 1 even when a ≡ 0 (mod n); actually 0^0 is undefined, but for k>0, 0^k ≡ 0.
  • Using CRT when moduli are not coprime; must check gcd first.
  • Dividing in modular arithmetic without ensuring the divisor has an inverse.
  • Misidentifying the cycle length when the base and modulus are not coprime; the cycle may start later.
  • Confusing quotient and remainder in the division algorithm.

Frequently asked questions

What is the remainder when a number is divided by 1?

The remainder is always 0 because every integer is divisible by 1. In the division algorithm, a = 1*a + 0, so r=0.

Can a remainder be negative?

No, by definition the remainder r in a = nq + r must satisfy 0 ≤ r < n. If you get a negative value, add the divisor to make it non-negative. For example, -1 mod 7 is 6.

How do I find the remainder of a large power like 2^100 mod 5?

Find the cycle of remainders for powers of 2 modulo 5: 2,4,3,1,2,... The cycle length is 4. Divide the exponent by 4: 100 ÷ 4 = 25 remainder 0, so the remainder is the last in the cycle, which is 1.

What is the Chinese Remainder Theorem?

It states that if you have a system of congruences with pairwise coprime moduli, there is a unique solution modulo the product of the moduli. It is used to find a number that leaves specified remainders when divided by several numbers.

When can I use Fermat's Little Theorem?

You can use it when the modulus is prime and the base is not a multiple of that prime. It states that a^{p-1} ≡ 1 (mod p). This helps reduce large exponents.

What is the remainder when 0 is divided by a non-zero number?

The remainder is 0 because 0 = n*0 + 0. The quotient is 0 and remainder is 0.