Introduction To Number Theory
Introduction To Number Theory
(for a 6= 0 or b 6= 0).
Note: This definition satisfies gcd(0, 1) = 1.
x, y such that xa + yb = 1.
Proof:
() Let d = gcd(a, b), and xa + yb = 1. d|a and d|b and therefore, d|1, and
thus d = 1.
() a and b are coprimes, i.e., gcd(a, b) = 1. Using the previous theorem, 1 is
the smallest positive integer in S = {ax + by : x, y IN }, i.e., x, y such that
ax + by = 1. QED
p1|q2q3 qr .
53= 1 39 + 14
39= 2 14 + 11
14= 1 11 + 3
11= 3 3 + 2
3= 1 2 + 1
2= 2 1 + 0
53= 1 39 + 14 14= 53 39
39= 2 14 + 11 11= 39 2 14 = 2 53 + 3 39
14= 1 11 + 3 3= 14 1 11 = 3 53 4 39
11= 3 3 + 2 2= 11 3 3 = 11 53 + 15 39
3= 1 2 + 1 1= 3 1 2 = 14 53 19 39
2= 2 1 + 0
Therefore, 14 53 19 39 = 1.
We will use this algorithm later as a modular inversion algorithm, in this case
we get that (19) 39 34 39 1 (mod 53).
Note that every ri is written as a linear combination of ri1 and ri2, and
ultimately, ri is written as a linear combination of a and b.
a0 = e
3. am an = am+n.
4. (am)n = anm.
e = as = aqorder(a,S)+r = (aorder(a,S))q ar = ar .
3. Distributivity: a (b c) = (a b) (a c).
Corollary: a S, a 0 = 0.
Proof: a 0 = a (0 0) = a 0 a 0, thus, a 0 = 0.
Examples: (Q, +, ), (Zp , +p, p) where p is a prime.
ab 0 (mod p)
iff
a 0 (mod p) or b 0 (mod p).
Proof:
() From p|a or p|b it follows that p|ab.
() p|ab. If p|a we are done. Otherwise, p 6 |a.
Since p a prime it follows that gcd(a, p) = 1. Therefore, p|b (by the fundamental
theorem of arithmetic). QED
xa + ym = 1.
Thus,
xa 1 (mod m).
QED
Conclusion: a has an inverse modulo m iff gcd(a, m) = 1. The inverse can
be computed by Euclids algorithm.
Z2 = {0, 1} Z2 = {1}
Z3 = {0, 1, 2} Z3 = {1, 2}
Z4 = {0, 1, 2, 3} Z4 = {1, 3}
Z5 = {0, 1, 2, 3, 4} Z5 = {1, 2, 3, 4}
Z1 = {0} Z1 = {0} !!!!!
Proof: Exercise.
Note: If the factorization of n is not known, (n) is not known as well.
Conclusions: For prime numbers p 6= q, and any integers a and b
1. (p) = p 1.
gcd(k, n/d) = 1.
But this is the definition of Eulers function, thus there are (n/d) such ks.
Since we count each a exactly once
X
(n/d) = n.
d |n
n
If d|n then also d = d divides n, and thus we can substitute n/d with d and
get X
(d) = n.
d|n
QED
Proof: a is an element in the Euler group Zm . Therefore, as a corollary from
Lagrange Theorem, a|Zm| = a(m) = 1 (mod m). QED
ap1 1 (mod p)
and
ap a (mod p).
QED
4. The numbers )1
1 2 3 order(a,Zm
1, a , a , a , . . . , a
are all distinct modulo m.
x = xn1xn2 . . . x1x0,
Pn1
where x = i=0 xi2i.
Therefore, ax mod q can be written as:
x 2(n1) xn1 2(n2) xn2
a =a a a2x1 ax0
(n1) x (n2) x
ax = a2 n1
a2 n2
a2x1 ax0
Algorithm:
r1
for i n 1 down to 0 do
r r2axi mod q (axi is either 1 or a)
At the end
n1
Y Pn1
xi 2i ( xi 2i )
r= a =a i=0 = ax (mod q).
i=0
u x (mod p)
u y (mod q).
u yi (mod mi).
We can assume (without loss of generality) that all the mis are coprimes in
pairs (i6=j gcd(mi, mj ) = 1). (If they are not coprimes in pairs, either they
can be reduced to an equivalent set in which they are coprimes in pairs, or
else the system leads to a contradiction, such as u 1 (mod 3) and u 2
(mod 6)).
Example: Given the moduli m1 = 11 and m2 = 13 find a number u
(mod 11 13) such that u 7 (mod 11) and u 4 (mod 13).
Answer: u 95 (mod 11 13). Check: 95 = 11 8 + 7, 95 = 13 7 + 4.
u y1 (mod m1)
u y2 (mod m2)
..
u yk (mod mk ),
Then,
u 7a + 4b (mod 11 13).
We conclude that
Thus,
u 7 13 6 + 4 11 6 810 95 (mod 11 13)
bi 1 (mod mi)
bi 0 (mod mj ), j 6= i (since mj |(m/mi)).
The solution is
u y1b1 + y2b2 + + yk bk
m
X
yibi (mod m).
i=1
mi|u1 u2.
QED
x2 4 0 (mod 35)
Thus, h|h.
On the other hand,
ash (as)h 1 (mod m)
and thus h|sh. Since gcd(h, s) = 1 then h|h.
QED
P
As we know that d|p1 (d) = p 1, it follows that:
X
0 = ((d) (d)) =
d|p1
X X
= ((d) (d)) + ((d) (d)) =
d|p1,(d)=0 d|p1,(d)6=0
X X X
= (d) + 0= (d)
d|p1,(d)=0 d|p1,(d)6=0 d|p1,(d)=0
(d) = (d).
QED
1 2 3 4 . . . (p 1) 1 (mod p).
Zp = {1, g, g 2, g 3, . . . , g p2}
and thus
1 2 3 4 . . . (p 1) 1 g g 2 g 3 . . . g p2
g (p2)(p1)/2 (mod p).
1 2 3 4 . . . (p 1) g (p2)(p1)/2 (mod p)
(1)p2 1 (mod p).
Thus,
0 g p1 1 (g (p1)/2 + 1)(g (p1)/2 1) (mod p).
g (p1)/2 6 1 (mod p) since order(g, Zp) = p 1 (and p is odd), and thus it
must be that g (p1)/2 1 (mod p).
QED