Section 4.4 – Congruences

definition: For a natural number $n \gt 1$, given integers $a$ and $b$, we says, $a$ is congruent to $b$ modulo $n$,

if,

or $\frac{a}{n}$ and $\frac{b}{n}$ have the same remainder.

Example

Since,

we can say,

Example

It's 11 AM. What time will it be in 22 hours?

Solution

It will be 9 AM (not 33 AM).

Why? Times rollover after 24 hours.

Example

Draw a $405^\circ$ ray.

Solution

Since angles rollover after $360^\circ$, we can draw $45^\circ$.

Least Residue mod $n$

definition:For integers $a$ and $b$ where $a \equiv b \pmod n$, we say $b$ is the least residue mod $n$ if $0 \le b \le n$.

Notice

is an equivalence relation with equivalence classes,

Example

The equivalence classes for $\bmod 3$ are,

Arithmetic $\bmod n$

Proposition

Let $a,b,c,d \in \mathbb Z$ and $n \in \mathbb N$, if,

then,

Proof

Suppose $a \equiv b \pmod n$ and $a \equiv d \pmod n$ so,

and,

so,

so,

so,

therefore,

Warning

does not imply $a \equiv b \pmod n$

Example

Let $b \equiv 2 \pmod 4$,

Proposition

If $ac \equiv bc \pmod n$ and $\gcd(c,n) = 1$ then,

Example

Solve,

Solution

$$$$

Example

Solve,

Solution

By trial and error, let $x \in [0]$,

(note $30 \pmod 4 \equiv 2 \pmod 4$), let $x \in [1]$,

let $x \in [2]$,

Fact

Example

Find the last digit of $3^{123}$.

Solution

We can find $3^{123} \pmod{10}$ instead

Application of Divisibility by 3

Notice if $3 \mid n$, then,

also,

To test if $3 \mid n$ we will start by writing,

so