Concept stop · What is it?

Congruences: Definitions and Basic Properties

In the Chinese book: 同余的概念与基本性质

On an m-hour clock, numbers that differ by a multiple of m are congruent.

📖 §2.1 of 《整除、同余与不定方程》M14 Choosing a Good Modulus line

Before this stop, visit:The Fundamental Theorem of Arithmetic (Concept)

Hands first, words secondDrag n. How do the hand on the clock face and the lit-up column of the table move together?

Loading figure…

Try this

  1. Each time goes up by , the hand moves one mark. Add times in a row and the hand is back where it started. In the table it has moved down one row, but it is still in the same column.
  2. Pick any two numbers in the same column and subtract. What is the difference always a multiple of?
  3. Drag to . Which column does it land in? Is that the remainder you expected?
  4. Switch to “Add”. Press , and a few times. Which of the three readouts never moves?
  5. Switch to “Multiply” and repeat step 4.

Definition Let be a positive integer. If , we say that is congruent to modulo and write .

Being congruent means “leaving the same remainder when divided by ”, which is the same as “being in the same column of the table”. Each column is called a residue class, and there are of them modulo .

Predict first

Today is Wednesday. What day of the week will it be days from now?

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

Why

Steps 4 and 5 say that before you add or multiply, you can replace each number by any other number in its column. Why does swapping change nothing?

Congruent numbers can replace each other

Step 1 / 5
Loading figure…
  1. Work it out once

    Mod : , which lands in the “≡0” column.

If you can swap in multiplication, you can swap in powers (repeated multiplication) too: if , then . So you can find the remainder of a number even when it is far too big to write down.

Example Find the remainder when is divided by . and , so

Remove one condition

Adding, subtracting and multiplying are all safe. Dividing (cancelling) is not, unless one extra condition holds.

Break it

Counterexample lab: remove one condition

Conclusion: if , you can cancel and get

Mod , multiply by . Each gets an arrow pointing to the remainder of . The seven arrows land in seven different places: if and land in the same place, then and must have started in the same place. So you can cancel.

Loading figure…

Practice

Exercise 1Basic

Find the remainder when is divided by .

Exercise 2Basic

Find the remainder when is divided by .

Exercise 3Advanced

Find the remainder when is divided by .

Exercise 4Challenge

Prove that for every positive integer , 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

Cancelling on both sides of a congruence without thinking

The wrong step: . Cancel the on both sides to get .
What went wrong? Think first, then open

Diagnosis is true, but is not a multiple of . and share the factor : in , part of the is “eaten” by the .

The right step: When you cancel , divide the modulus by at the same time: from you only get . Only when can you cancel and keep the modulus.

“Add, subtract and multiply freely; before cancelling, check coprimality”

Exhibit

Giving a negative number a negative remainder

The wrong step: divided by leaves remainder (or ).
What went wrong? Think first, then open

Diagnosis A remainder must be between and . means going back marks from , which lands on mark . And and differ by , not a multiple of , so they are not even in the same column.

The right step: , so the remainder is , that is, .

“Negative numbers go backwards round the clock”

Exhibit

Reducing the exponent mod m as well

The wrong step: , so .
What went wrong? Think first, then open

Diagnosis Congruent numbers can be swapped in the base. The exponent is not a number being added or multiplied, and there is no such rule for it. In fact , while .

The right step: First find the period of the powers: , so the exponent should be reduced mod . , so .

“Reduce the base mod m and the exponent mod the period”