Congruences
3.1 Congruence Modulo n
Section titled “3.1 Congruence Modulo n”Definition. For integers and , is congruent to modulo , written , if ; equivalently, and leave the same remainder on division by .
Congruence is an equivalence relation: reflexive (), symmetric, and transitive (if and then ). It partitions into residue classes , each containing all integers with the same remainder.
3.2 Arithmetic Modulo n
Section titled “3.2 Arithmetic Modulo n”Congruences respect addition and multiplication: if and , then
Proof. and .
Consequences: powers reduce freely; ; and polynomials with integer coefficients preserve congruence. This is what makes “reduce as you go” legal in exponent calculations.
Warning (division). Congruence does not respect division in general: from you can conclude , and only when . For example and , but .
The residue classes form a commutative ring with identity under class addition and multiplication. A class is invertible (a unit) precisely when , in which case the extended Euclidean algorithm gives , so ; the inverse is the class of . The units form a group of order ; see Arithmetic Functions.
When is prime, every nonzero class is invertible, so is a field.
3.4 Reducing Exponents
Section titled “3.4 Reducing Exponents”Any power tower collapses modulo by reducing the base modulo first, and the exponent via Euler/Fermat when the base is invertible:
- Last digit of : cycles with period 4; since , the answer is .
- , so the last two digits of follow from : .
Carmichael’s theorem refines the exponent period to , and the order of an element divides ; worth stating in a proof-based answer.
3.5 Worked Problems
Section titled “3.5 Worked Problems”Problem 1. Show that whenever is even.
, so : the claim holds for even , while odd gives . In fact , so the order of 2 modulo 17 is exactly 8.
Problem 2. Find the remainder of on division by 7.
, , , (the order of 3 is 6). Since : .
Problem 3. Prove that no integer of the form is a sum of two squares.
Squares mod 4 are 0 and 1, so a sum of two squares is or ; never 3.
3.6 Common Pitfalls
Section titled “3.6 Common Pitfalls”- Subtracting congruences across different moduli: and gives , not mod 3 or 24.
- Exponent reduction requires (Euler) or knowledge of the element’s order; otherwise reduce only the base.
- In there are zero divisors when is composite: in ; products can vanish without a zero factor.
See Also
Section titled “See Also”- Fermat, Euler and Wilson Theorems
- Linear Congruences and the Chinese Remainder Theorem
- Number Theory and Cryptography
3.x A Supply-and-Demand Check
Section titled “3.x A Supply-and-Demand Check”Residue classes are preserved by polynomial evaluation: if then for any integer polynomial . Verify for with , , before using it in proofs.
The multiplicative property is what powers fast exponentiation: reduce the base once, then multiply reduced residues. In exams, reduce after every multiplication to keep numbers small; the marker expects reduced residues, not 30-digit intermediates.
A standard application: divisibility tests. The rule for 11 follows from , so a decimal number alternately sums its digits. Reproduce this derivation once and the rule is yours forever.
A final check worth one mark: reduce every intermediate result immediately, and state the residue class, e.g. “the answer is the class of 4 modulo 7”, rather than only the integer. For multi-step reductions, tabulate powers as you go: the table of , , , modulo converts any exponent to its binary form and avoids every overflow risk.
3.7 A Closing Worked Reduction
Section titled “3.7 A Closing Worked Reduction”Reduce : Fermat gives , so . Now , , , and .