2.5.6 · D5Number Theory (Intermediate)

Question bank — Modular arithmetic — definition, addition, multiplication, congruence

1,696 words8 min readBack to topic

This bank targets the ideas behind modular arithmetic, not the arithmetic. Every trap below is a place where intuition from ordinary numbers quietly breaks. Read the prompt, commit to an answer out loud, then reveal.

Reminder of the vocabulary you'll need (all built in the parent note):

  • means == is a whole-number multiple of == — equivalently, and leave the same remainder when divided by .
  • The modulus is the "wrap-around" number; the residue (or remainder) is the standard representative in .
  • A divisor of is a whole number that divides evenly (no remainder) — e.g. is a divisor of because .
  • Two numbers are coprime if their greatest common divisor is .
  • (Euler's totient) counts how many numbers in are coprime to — i.e. how many residues have an inverse. E.g. (only and ).
Figure — Modular arithmetic — definition, addition, multiplication, congruence

True or false — justify

TF1. If then .
True — congruence is symmetric. If then , still an integer multiple of , so the roles swap freely.
TF2. If then and are equal.
False — they are equal as residue classes, not as integers. but ; they only share the same remainder.
TF3. If , then for every divisor of (a whole number that divides evenly).
True — if is a multiple of , and divides , then is also a multiple of . Congruence "survives" moving to a divisor modulus.
TF4. If and , then .
False — you get mod the least common multiple , not the product . See GCD and LCM; multiplying moduli only works when they are coprime.
TF5. always implies .
False — you may only cancel when . E.g. but , because .
TF6. Every non-zero residue mod has a multiplicative inverse.
False — only residues coprime to do. Mod , the number has no inverse since ; see Modular Inverses.
TF7. If is prime, every non-zero residue mod has an inverse.
True — for prime , every in satisfies , so all of them are invertible. This is what makes prime moduli so friendly for Linear Congruences.
TF8. implies .
False — squaring loses sign information. Mod , and , yet . This is exactly the subtlety behind Quadratic Residues.
TF9. There are exactly residue classes modulo .
True — every integer lands in exactly one of the buckets by the Division Algorithm, which guarantees a unique remainder in that range.

Spot the error

SE1. ", since is already smaller than ."
The standard residue must be non-negative: add to get . "Smaller than " is not the rule; "in " is.
SE2. ", so ."
You can't divide by because . Instead divide the whole congruence and the modulus by : .
SE3. " and , so ."
Exponents do not reduce mod . The base can be swapped (), but the exponent lives in a different world — its reduction is governed by Eulers Theorem or Fermats Little Theorem, mod (Euler's totient), not mod .
SE4. " has the unique solution ."
It has five solutions in : every even value makes a multiple of . When , the congruence has exactly solutions — here .
SE5. "Since , the number must equal mod ."
A product being does not force a factor to be when the modulus is composite. and are zero divisors mod ; neither is itself.
SE6. " just means , so mod is fine."
The modulus is degenerate: " is a multiple of " forces , so it collapses to ordinary equality and no wrap-around exists. We require (usually ) for modular arithmetic to be interesting.
SE7. "To reduce I must first add to get , then divide."
You may, but you don't have to — the addition rule lets you reduce first: . For huge numbers, reducing first is the whole point (this powers RSA Cryptography).

Why questions

WHY1. Why is congruence an equivalence relation and not just "sometimes true"?
Because it is reflexive (), symmetric (negate ), and transitive (add the two differences). Those three together let us treat whole classes as single objects.
WHY2. Why does reducing the base before taking a power work, but reducing the exponent does not?
The multiplication rule applies to bases repeatedly, so bases reduce mod . The exponent counts how many times you multiply — that count isn't a factor being multiplied, so it follows a separate cycle length (Euler's totient), not (Eulers Theorem).
WHY3. Why do we need to divide by ?
Dividing by means multiplying by an inverse with . Such an inverse exists only when and share no common factor, otherwise no multiple of ever lands on . See Modular Inverses.
WHY4. Why does the Chinese Remainder Theorem insist the moduli be coprime?
Coprime moduli guarantee the combined system pins down a unique residue mod the product. With a shared factor the two conditions can either overlap redundantly or contradict, so uniqueness breaks.
WHY5. Why can two different numbers square to the same residue?
Because and (i.e. ) always share a square: . Squaring folds the circle in half, so it can't be undone by a single "square root". This is the heart of Quadratic Residues.
WHY6. Why is mod arithmetic called "clock arithmetic"?
A clock has finitely many positions and wraps: after the top you return to the start. Residue classes are exactly the finitely many marks on that circle, and adding is stepping around it.
WHY7. Why does the multiplication rule stay valid even for negative operands?
The proof only used " is a multiple of ", which is a statement about differences, not about signs. Negatives are handled by choosing a negative , so nothing changes.

Edge cases

EC1. What is every integer congruent to, modulo ?
Everything is . Since divides every difference, there is a single residue class — the whole number line collapses to one point.
EC2. Is ? What class is in?
Yes — . Zero sits in the class of all multiples of : .
EC3. What are the residues of and mod , and when do they coincide?
They coincide only when — e.g. always, and when is even. Otherwise , the "mirror" position on the circle.
EC4. Does with negative make sense?
Yes, but it's identical to , since "multiple of " and "multiple of " describe the same set. By convention we always write a positive modulus.
EC5. If , when does have any solution?
Exactly when divides (i.e. is a divisor of ). If it does, there are precisely solutions mod ; if not, there are none. This is the solvability test for Linear Congruences.
EC6. What happens to "reduce to " when the input is already in range but the operation overshoots by exactly ?
Landing on itself wraps to : e.g. . The top of the range and the bottom are the same mark on the clock.
EC7. For prime modulus , how many square roots can a nonzero residue have?
At most two — and . A quadratic can have no more than two roots in the field of residues mod a prime, unlike composite moduli where roots can multiply (mod , the residue has four).

Recall One-line self-test

Why can you swap a base but never an exponent inside a congruence? ::: The base is a factor obeying the multiplication rule (mod ); the exponent is a count of multiplications, governed by a separate cycle length (mod the totient).