5
Z
n,
Z
n
*
The integers modulo n denoted by
Z
n
is the set of
integers 0,1,2.
..n-1.
Z
12
={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
a
≡
b (mod n) if n | a - b
Let a
∈
Z
n
, the
multiplicative inverse
of a is an
integer x
∈
Z
n
, s.t. ax
≡
1 (mod n)
5 x
´
1 (mod 12)
x
´
5 (mod 12)
5 x
´
1 (mod 14)
x
´
11 (mod 14)
a is invertible iff gcd(a,n) = 1
Z
n
*
={ a
∈
Z
n
| gcd(a,n)=1}
Z
12
*
={1, 5, 7, 11}, Z
14
*
={1, 3, 5, 9, 11, 13}
If n is a prime then Z
n
*
={ a
∈
Z
n
| 1
≤
a
≤
n-1}
6
CRT
Given r integers which are
pairwise relatively prime
,
m
1
, m
2
,…, m
r
, then
x
≡
b
1
(mod m
1
)
x
≡
b
2
(mod m
2
)
x
≡
b
3
(mod m
3
)
….
x
≡
b
r
(mod m
r
)
has the unique solution :
x = y
1
b
1
M
1
+ … + y
r
b
r
M
r
mod M
where M =
Π
m
i
, M
i
= M/m
i
, y
i
M
i
≡
1 (mod m
i
).