Concept stop · What is it?

Residue Systems and Their Uses

In the Chinese book: 剩余系及其应用

One number per class is a complete residue system. Coprime a just reorders it.

📖 §2.2 of 《整除、同余与不定方程》M14 Choosing a Good Modulus lineM16 The Pigeonhole Principle line

Before this stop, visit:Congruences: Definitions and Basic Properties (Concept)

Hands first, words secondChange the multiplier a and the modulus m. When is every place hit by exactly one arrow?

Loading figure…

Try this

  1. : drag from to . Do any arrows ever collide?
  2. : compare with . Then try every from to and write down all the with no collisions.
  3. When there are collisions, look at “Places reached”: with , only places are reached. How many for ? How is that related to ?
  4. When there are collisions, what do the numbers at the places that get hit have in common? (, : .)

Take one number from each residue class mod . The numbers you get form a complete residue system mod . In other words: integers that are pairwise incongruent.

A complete residue system mod can be , or , or even . Any consecutive integers form a complete residue system.

Predict first

Write down any integers. Which statement below is always true?

Choose an answer first; then you can see the result.

Why

When (a, m) = 1, multiplying by a just reorders

Step 1 / 6
Loading figure…
  1. What we want to prove

    Mod , multiply by : each of the seven remainders sends out one arrow. We want to prove that as long as , the arrows all land in different places.

What it is good for: check just one period

In an expression that only uses addition, subtraction and multiplication, replacing by a congruent number does not change the remainder of the result. So to find every possible value mod , you only need to put in the numbers of one complete residue system for , one at a time.

For example, what remainders can leave when divided by ? Just check :

Loading figure…
Five numbers stand in for all the integers. A square divided by can only leave . Drag the modulus m to see others.

Remove one condition

Break it

Counterexample lab: remove one condition

Conclusion: when runs through a complete residue system mod , so does

, . Nine arrows, nine landing places: no repeats, none missed.

Loading figure…

Practice

Exercise 1Basic

Find the with such that .

Exercise 2Basic

For which among is a complete residue system mod ?

Exercise 3Advanced

What is the smallest number of integers you must pick to be sure that two of them differ by a multiple of ?

Exercise 4Challenge

Prove that from any integers you can always choose whose sum is divisible by .

Mistake Museum · Exhibits from this stop

Before you leave, look at the traps other people fell into here.See every exhibit in the museum →

Exhibit

Taking any m numbers as a complete residue system

The wrong step: are exactly numbers, so they form a complete residue system mod .
What went wrong? Think first, then open

Diagnosis They are all even. Divided by , they leave only the remainders , each one twice; the classes with remainder have no representative at all.

The right step: A complete residue system needs numbers that are pairwise incongruent, for example , or .

“Counting is not enough; check for collisions”

Exhibit

Saying “ax also runs through all of them” without checking coprimality

The wrong step: When runs through a complete residue system mod , so does .
What went wrong? Think first, then open

Diagnosis . is always a multiple of , so it can only land on the three places , with arrows crowded onto each.

The right step: Only when does (and ) also run through a complete residue system. Mod , the values of that qualify are .

“If the multiplier is coprime to the modulus, the line-up stays in order”