3.3 Congruences

One of the most basic and useful notions in number theory is modular arithmetic, or congruences.

Definition

Let a, b, n be integers with n0. We say that

ab(modn)

(read: a is congruent to b mod n) if ab is a multiple (positive or negative or zero) of n.

Another formulation is that ab(modn) if a and b differ by a multiple of n. This can be rewritten as a=b+nk for some integer k (positive or negative).

Example

327(mod5), 1237(mod7), 1717(mod13).

Note: Many computer programs regard 17(mod10) as equal to the number 7, namely, the remainder obtained when 17 is divided by 10 (often written as 17%10=7). The notion of congruence we use is closely related. We have that two numbers are congruent mod n if they yield ...

Get Introduction to Cryptography with Coding Theory, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.