Divisibility and Modular Arithmetic
Divisibility and Modular Arithmetic
MODULAR
ARITHMETIC
REPORTERS: ALJUN S. JUTBA
REBECCA S. TARAJI
Division
When one integer is divided by a second nonzero integer, the quotient may or may
not be an integer.
If a and b are integers with a = 0, we say that a divides b if there is an integer c
such that b = ac, or equivalently, if b over a is an integer. When a divides b we say
that a is a factor or divisor of b, and that b is a multiple of a. The notation a | b
denotes that a divides b. We write a | b when a does not divide b.
Example 1:
2 |8 5|13
=8/2 = 13 / 5
=4 = 2.6
The Division Algorithm
1. 17 Ξ 5 (mod 6) CHECKING:
17 – 5 = 12 6 17
12/6 = 2 12
5
2. 15 Ξ 3 (mod 12) 12 15
15 – 3 = 12 12
12/12 = 1 3
Example:
3. 10 Ξ 2 (mod 6) CHECKING:
10 – 2 = 8 6 10
8/6 = 1.3 6
4
4. 13 Ξ 3 (mod 13) 13 13
13 – 3 = 10 13
10/13 = 0.8 0
Example:
5. -1 Ξ 1 (mod 2) CHECKING:
-1-1 = -2 2 -1
-2/2 = -4 -2
1
Arithmetic Modulo m
We can define arithmetic operations on Zm, the set of nonnegative integers less than m,
that is, the set {0, 1,...,m − 1}. In particular, we define addition of these integers, denoted
by +m by a +m b = (a + b) mod m, where the addition on the right-hand side of this
equation is the ordinary addition of integers, and we define multiplication of these
integers, denoted by ·m by a ·m b = (a · b) mod m, where the multiplication on the right-
hand side of this equation is the ordinary multiplication of integers. The operations +m
and ·m are called addition and multiplication modulo m and when we use these
operations, we are said to be doing arithmetic modulo m
Example:
Find 7 + 9 and 7 * 9