1 Factorisation of Integers
Definition N={1, 2, 3, . . .} are the natural numbers.
Definition Z={. . . , −2, −1, 0, 1, 2, . . .} are theintegers.
Closed under the binary operations +, ×, −
Definition α∈R then bαc is the greatest integer which is less than or equal to α.
Ex b3c= 3, √ 2
= 1, b−πc=−4 Then bαc6α <bαc+ 1
Proposition 1 If a and b are two integers with b > 0 then there are integers q and r with 06r < b and a=qb+r.
Proof. Let α= ab.
⇒ 0 6 ab −a
b
< 1
⇒ 0 6 a−ba
b
< b so if r=a−ba
b
then a =qb+r with q=a
b
.
Definition If a=cb (a, b, c∈Z) we say a is amultiple of b, or b divides a and write b|a.
Proposition 2 If b6= 0, c6= 0 then
(a) b|a and c|b ⇒ c|a (b) b|a ⇒ bc|ac
(c) c|d and c|e ⇒ ∀m, n∈Z, c|dm+en.
Proposition 3 Let a, b >0. If b|a and b6=a then b < a.
Definition If b|a and b 6= 1 or a then we sayb is aproper divisor of a. Ifb doesnot divide a write b -a.
Definition P ={p ∈ N :p > 1 and the only divisors of p are 1 and p} are the prime numbers. Then N\(P∪ {1}) are the composite numbers.
P={2, 3, 5, 7, 11, 13, 17, 19, 23, . . .}.
Theorem 1 Every n >1, n∈N, is a product of prime numbers.
Proof. If n ∈ P we are done. If n is not prime, let q1 be the least proper divisor of n.
Thenq1 is prime (since otherwise, by Prop 3, it would have a smaller proper divisor). Let
n = q1n1, 1< n1 < n. If n1 is prime we are done. If not n1 = q2n2, 1 < n2 < n1 < n.
This process must terminate in less than n steps. Hence n=q1q2. . . qs with s < n.
Ex 10725 = 3·5·5·11·13
In a prime factorization ofnarrange the primes so thatp1 < p2 <· · ·< pkand exponents αi ∈N, 16i6k so
n = pα11pα22· · ·pαkk
=
k
Y
j=1
pαjj
is the standard factorisation of n.
Prime Numbers
We can use the sieve of Eratosthenesto list the primes 26p6N. If n6 N and n is not prime, then n must be divisible by a prime p6√
N (if p1 >√ N and p2 >√
N ⇒ p1p2 > N).
List all of the integers between 2 and N
2, 3, 4,5, . . . , N successively remove
(i) 4, 6, 8, 10, . . . even integers from 22 on (ii) 9, 15, 21,27, . . . multiples of 3 from 32 on (iii) 25,35, 55, 65, . . . multiples of 5 from 52 on etc.
i.e. remove all integers which are multiples of a prime p < √
N. We are left with all primes up to N.
Ex N = 16, √ N = 4
{2, 3, 64, 5,66, 7, 68,69, 610,11, 612, 13, 614, 615,16}6
Theorem 2 |P|=∞, i.e. there are an infinite number of primes.
Proof. Let P={p1, p2, . . . , pn} with p1 < p2 <· · · < pn and let q =Qn
j=1pj+ 1. Then q > pj ∀j ⇒ q 6∈ P so q is composite. But pi|q ⇒ pi|q−Qn
j=1pj = 1 ⇒ pi = 1 which is false. Hence |P|=∞.
How many primes are there ?
Note:
∞
X
n=1
1
n = ∞
∞
X
n=1
1
n2 = π2 6 <∞.
We can show
∞
X
j=1
1 pj
=∞ so the primes are denser than the squares.
If x >0, let S(x) = #{n∈N:n2 6x}. Then S(x) =b√
xc. We can show π(x) = #{p∈P:p6x}
∼ x
log(x)
Definition A modulusis a set of integers closed under ±. The zero modulusis just {0}. If a∈Z then M ={na:n∈Z} is a modulus.
Proposition 4 If M is a modulus with a, b∈M and m, n∈Z then ma+nb∈M. Proof. a ∈M ⇒ a+a = 2a ∈M ⇒ 2a+a = 3a ∈M etc. so ma∈M and so is nb, thus ma+nb∈M.
Proposition 5 If M 6= {0} is a modulus, it is the set of multiples of a fixed positive integer.
Proof. Let d be the least positive integer in M with 0< d.
Claim: every element of M is a multiple of d. If not (???) let n ∈ M have d -n. Then n=dq+r with 16r < d. But r=n−dq ∈M (!!!).
Definition Leta, b∈Zand let M ={ma+nb:m, n∈Z} then M is generated by din that M ={nd:n ∈Z}. We calld the greatest common divisor orGCD of a and b, and write (a, b) = d.
Proposition 6
(i) ∃x, y ∈Z so ax+by = (a, b) (ii) ∀x, y ∈Z, (a, b)|ax+by (iii) If e|a and e|b then e|(a, b)
Definition If (a, b) = 1 we say a and b are coprime.
Ex The GCD (greatest common divisor) is normally computed using the Euclidean Algorithm. From Proposition 5: (a= 323, b = 221)
323 = 221·1 + 102 so 102∈M 221 = 102·2 + 17 so 17∈M 102 = 17·6 + 0
so 17 is the least positive integer inM ⇒ (323, 221) = 17. Reading back:
17 = 221−2·102
= 221−2·(323−221)
= 3·221−2·323 so (a, b) =xa+yb ⇒ x=−2, y = 3.
Proposition 7 If p∈P and p|ab then p|a or p|b.
Proof. If p-a then (a, p) = 1. By Prop 6(i)∃x, y ∈Z so xa+yp = 1
⇒xab+ybp = b But p|abso ab=qp. Hence (xq+yb)p=b so p|b.
Proposition 8 If c >0 and (a, b) =d then (ac, bc) =dc.
Proof. ∃x, y ∈Z so
xa+yb = d
⇒ x(ac) +y(bc) = dc
⇒ (ac, bc)|dc. Also d|a ⇒ cd|ca (and similarly cd|cb) ⇒ dc|(ac, bc). Hence dc= (ac, bc).
Theorem 3 (Fundamental Theorem of Arithmetic) The standard factorisation of a number n∈N is unique.
Proof. If p | ab· · ·m, by Proposition 7, p must divide one of the factors. If each of these is prime, then p must be one of them. If n = pα11· · ·pαii = q1β1· · ·qjβj are two standard factorizations of n, each p must be a q and each q a p. Hence i = j. Since p1 < p2 <· · ·< pk and q1 < q2 <· · ·< qk, p` =q` for 16`6k. If β1 < α1, divide n by pβ11 to getpα11−β1pα22· · ·=pβ22· · · ⇒ α1 =β1 etc.
Proposition 9 Let a, b∈N have non-standard factorisations a=
m
Y
j=1
pαjj
and
b=
m
Y
j=1
pβjj with αj >0, βj >0 then
(a, b) =
m
Y
j=1
pmin (αj j, βj).
Ex
a = 223451 b = 213051
⇒ (a, b) = 213051
Definition Leta, b∈ Z+ ={0, 1, 2, . . .} =N∪ {0}. Theleast common multiple or LCM of a and b is the smallest common multiple of a and b and is written {a, b}.
Ex {3, 4}= 12
Proposition 10 With the same notation as for Proposition 9, {a, b}=
m
Y
j=1
pmax (αj j, βj).
Proposition 11 Any common multiple of a and b is a multiple of the least common multiple.
Proposition 12 {a, b}(a, b) = ab Proof.
LHS =
m
Y
j=1
pmax (αj j, βj)+min (αj, βj).
But ∀x, y max (x, y) + min (x, y) =x+y. Hence LHS =
m
Y
j=1
pαjj+βj =
m
Y
j=1
pαjj ·
m
Y
j=1
pβjj =ab.
Alternative Characterisation of the GCD
By Proposition 6 (ii), (a, b)|ax+by.
Let x= 1, y = 0 ⇒ (a, b)|a.
Let x= 0, y = 1 ⇒ (a, b)|b.
Sog = (a, b) is a common divisor of a and b. By Proposition 6 (iii), ife|a and e|b then e|g i.e. g is divisible by every common divisor. Hence it is the greatest. This property:
“being a common divisor divisible by every common divisor” characterises the GCD up to sign.
Proof. If g1 and g2 satisfy this property, then g1 and g2 are both common divisors with g1|g2 and g2|g1. Hence g2 = αg1 = αβg2 ⇒ αβ = 1 if g2 6= 0. Hence α = ±1. So g1 =±g2. The GCD, so defined by the above property, ismade unique by fixing the sign, g >0.
Ex
divisors of 12 = {±1, ±2, ±3, ±4, ±6, ±12}=D12 divisors of 18 = {±1, ±2, ±3, ±6, ±9, ±18}=D18 common divisors = {±1, ±2, ±3, ±6}=D12∩D18 So±6 satisfies the property. Hence, fixing the sign, 6 = (12, 18).
Linear Equations in Z
Proposition 13 Given a, b, n ∈ Z, the equation ax+by = n has an integer solution x, y ⇔ (a, b)|n.
Proof. (⇐) By Proposition 6 (i) ∃x, y such thatax+by= (a, b). Since (a, b)|n, ∃csuch that (a, b)c=n Hence a(xc) +b(yc) = (a, b)c=n and xc, yc is the solution.
(⇒) By Proposition 6 (ii), (a, b)|ax+by =n.
Proposition 14 Let (a, b) = 1 and let x0, y0 be a solution to ax+by =n (a solution exists by Proposition 13). Then all solutions are given by
x = x0+bt
y = y0−at , t∈Z.
Proof.
a(x0+bt) +b(y0−at) = ax0+abt+by0−bat
= n
so each such x and y is a solution. If ax0 + by0 = n and ax +by = n also, then a(x−x0) +b(y−y0) = n−n = 0. But (a, b) = 1. Hence b|x−x0 ⇒ bt=x−x0 so x=x0+bt ⇒ abt+b(y−y0) = 0 ⇒ y−y0 =−atif b 6= 0.
Theorem 4 If(a, b) = 1, a >0, b >0then every integer n > ab−a−bis representable as n =ax+by, x>0, y>0 and ab−a−b is not.
Proof. By Proposition 14,
x = x0+bt y = y0−at
Choose t so that 0 6y0−at < a ⇒ 06y0−at6a−1. But
(x0+bt)a=n−(y0−at)b > ab−a−b−(a−1)b =−a
⇒ (x0+bt) > −1
⇒ (x0+bt) > 0.
Hence n is representable. Finally suppose ax+by=ab−a−b (???) x>0, y >0.
⇒ a(x+ 1) +b(y+ 1) =ab.
But (a, b) = 1, hencea|y+ 1 (a(x+ 1−b) =b(−y−1)) and b|x+ 1. ⇒ a 6y+ 1 and b6x+ 1 so ab= (x+ 1)a+ (y+ 1)b>ba+ab= 2ab (!!!).
Definition n ∈N
σ(n) = sum of the divisors of n
= X
d|n
d
Ex σ(12) = 1 + 2 + 3 + 4 + 6 + 12 = 28 σ(6) = 1 + 2 + 3 + 6 = 12 = 2(6).
Perfect Numbers
Definition A perfect number is equal to the sum of its proper divisors
n = X
d|n 16d < n
d
orσ(n) = 2n.
Ex 6, 28
Proposition 15 If n=Qm
j=1pαjj then σ(n) =
m
Y
j=1
pαjj+1−1 pj −1
Proof. All divisors ofn have the form d=px11· · ·pxmm with 06xj 6αj. Hence σ(n) =
α1
X
x1=0
· · ·
αm
X
xm=0
px11· · ·pxmm
=
α1
X
x1=0
px11
!
· · ·
αm
X
xm=0
pxmm
!
= RHS above.
Definition A functionf :N→Nis calledmultiplicative ifa, b∈Nand (a, b) = 1 ⇒ f(ab) = f(a)f(b)
Proposition 16 (a, b) = 1 ⇒ σ(ab) =σ(a)σ(b) i.e. σ is a multiplicative function.
Proof. This follows from Proposition 15.
Theorem 5 Let p = 2n−1 be prime. Then m = 12p(p+ 1) = 2n−1(2n−1) is perfect.
Every even perfect number has this form.
Proof. m = 12p(p+ 1) = 2n−1p1 and p is odd. By Proposition 15 σ(m) = 2n−1
2−1 · p2−1 p−1
= (2n−1)(p+ 1)
= p(p+ 1)
= 2m
so m is perfect. Let a be an even perfect number. a = 2n−1u, u > 1,2 - u. (Note that σ(2α) = 2α+1−16= 2·2α, so no power of 2 is perfect.) Since σ is multiplicative,
σ(a) = 2n−1
2−1σ(u) = 2a= 2nu since a is perfect. Hence
σ(u) = 2nu
2n−1 =u+ u 2n−1.
Butu|u and 2nu−1|usou has just two divisors henceu∈Pand 2nu−1 = 1 ⇒ u= 2n−1.
Conjecture There are no odd perfect numbers.
Definition If p= 2n−1∈P we say p is a Mersenne Prime.
Theorem 6 If n > 1 and an−1 is prime then a= 2 and n is prime.
Proof. If a >2 then a−1|an−1 (an−1 = (a−1)(an−1+an−2+· · ·+ 1)) soan−16∈P. If a= 2 and n=j`, wherej is a proper divisor of n, then 2n−1 = (2j)`−1 is divisible by 2j −1 (a= 2j in the equation above). Hence n ∈P.
web: http://www.utm.edu/research/primes/mersenne.shtml Theorem 7 If 2m+ 1 ∈P then m= 2n.
Proof. If m=qr, whereq is odd, then
2qr+ 1 = (2r)q+ 1 = (2r+ 1)(2r(q−1)−2r(q−2)+· · ·+ 1) and 1<2r+ 1<2qr+ 1 so 2qr+ 1 cannot be prime. Hence m has no odd prime factor. Hence m= 2n, n∈N.
Note The factorization
an−bn = (a−b)(an−1+an−2b+an−3b2+· · ·+bn−1) works here for odd n since
an+ 1 = an−(−1)n
= (a−(−1))(an−1+an−2(−1) +an−3(−1)2+· · ·(−1)n−1)
= (a+ 1)(a+ 1)(an−1−an−2+an−3− · · ·+ 1)
Fermat Numbers
Definition The nth Fermat number,Fn= 22n+ 1 F0 = 3, F1 = 5, F2 = 17, F3 = 257, F4 = 65537.
Fi ∈P for 06i64. No other Fermat prime is known.
F5 6∈P.
(Euler, 1732): 641|225 + 1 = 641·6700417.
Proof. Let
a = 27 b = 5 a−b3 = 3
1 +ab−b4 = 1 + 5·3 = 24
Therefore
225 + 1 = (28)4+ 1
= (2a)4+ 1
= 24a4+ 1
= (1 +ab−b4)a4 + 1
= (1 +ab)a4+ 1−a4b4
= (1 +ab)a4+ (1−a2b2)(1 +a2b2)
= (1 +ab)[a4+ (1−ab)(1 +a2b2)]
and 1 +ab= 641.
Theorem 8 (Lagrange) If p∈P, the exact power α of p dividing n! (pαkn!) is α=
n p
+
n p2
+
n p3
+· · ·
Proof.
n! = 1·2· · ·(p−1)
·p(p+ 1)· · ·2p· · ·(p−1)p
·p2
· · ·
There are j
n p
k
multiples of p,j
n p2
k
multiples of p2, etc.
Each multiple of p contributes 1 to α. Each multiple of p2 has already contributed 1, being a multiple of p, so contributes 1 more toα leading to
n p
+ n
p2
etc. Hence
α = n
p
+ n
p2
+ n
p3
+· · ·+ n
pr
where r is the first N such that pr+1 > n. So j
n pβ
k
= 0 ∀β >r+ 1.
Ex n= 12, p= 3 so
α =
12 3
+
12 9
+
12 27
= 4 + 1 + 0
= 5.
12! = 12 · 11 · 10 · 9 · 8 · 7 · 6 · 5 · 4 · 3 · 2 · 1
↓ ↓ ↓ ↓
1 2 1 1
and 35k12! .
2 Congruences
Definition a≡b (mod m) if m|a−b, m6= 0, a, b, m∈Z. If so we say aiscongruent tob modulo m. We call m the modulus.
Proposition 17 ≡ is an equivalence relation on Z and the set of equivalence classes forms a ring (Zm,+, ·, [ 1 ]m) where
[a]m+ [b]m = [a+b]m [a]m·[b]m = [a·b]m
Proposition 18
a1 ≡ b1 (mod m) a2 ≡ b2 (mod m)
⇒ a1·a2 ≡ b1·b2 (mod m) a2+a2 ≡ b1+b2 (mod m)
Proposition 19
ac ≡ bd (mod m) c ≡ d (mod m) (c, m) = 1
⇒ a≡b (mod m)
Proof. (a−b)c+b(c−d) =ac−bd≡0 (mod m) ⇒ m|(a−b)c ⇒ m|a−b soa ≡b (mod m).
If m ∈ P then (c, m) = 1 ∀c ∈ Z with m - c, c 6= 0 and ∃x, y ∈ Z so that cx+my = (c, m) = 1 socx ≡1 (mod m). Hence [c]m has a multiplicative inverse class [x]m and (Zm, +, ·, [ 1 ]m) is a field GF(m) called a Galois field.
Note [c]m is called a residue class with representative c. Each class has a smallest non-negative representative.
Ex m= 5
GF(5) ={[ 0 ]5, [ 1 ]5, [ 2 ]5, [ 3 ]5,[ 4 ]5}
Proof. If c∈Zand m >0, ∃q, r so that c=mq+r, 06r < m and c≡r (mod m) ⇒ [c]m = [r]m
Euler’s Phi Function φ
Definition φ(n) = #{i 6 n : 1 6 i and (i, n) = 1} is the number of natural numbers less than n and coprime to n.
Ex φ(1) = 1, φ(2) = 1, φ(4) = 2 since (1, 4) = 1, (2, 4) = 2, (3, 4) = 1, (4, 4) = 4.
Ex p∈P ⇒ φ(p) =p−1 since (p, 1) = 1, (p, p) = pand (p, j) = 1, 1< j < p.
Consider m >1. In Zm, [c]m will have an inverse class ⇔ (c, m) = 1.
(⇐)cx+my= (c, m) = 1 ⇒ cx≡1 (mod m).
Hence thenumber of classes which have inverses is φ(m).
Definition A reduced residue system is a complete set of representatives for those classes with inverses.
Ex {1,3} is such a system for Z4.
Proposition 20 If a1, . . . , aφ(m) is a reduced residue system and (m, k) = 1 then ka1, . . . , kaφ(m) is also a reduced residue system.
Proof. (ai, m) = 1 ⇒ (kai, m) = 1. If kai ≡ kaj (mod m) ⇒ ai ≡ aj (mod m) ⇒ i=j. Hence the kai represent distinct residue classes, and each is coprime with m.
Theorem 9 (Euler) (a, m) = 1 ⇒ aφ(m) ≡1 (mod m).
Proof. The {aai : 1 6 i 6 φ(m)} and {ai : 1 6 i 6 φ(m)} represent the same classes (albeit in a different order). Hence
φ(m)
Y
j=1
(aaj) ≡
φ(m)
Y
j=1
aj (mod m)
⇒ aφ(m)
φ(m)
Y
j=1
aj
≡
φ(m)
Y
j=1
aj
(mod m) and so aφ(m)≡1 (mod m) since (aj, m) = 1 means we can cancel.
Corollary (Fermat’s Little Theorem) (a, p) = 1 ⇒ ap ≡a (mod p).
Proof. φ(p) =p−1 so ap−1 ≡1 (mod p) ⇒ ap ≡a (mod p).
Note Simple probabilistic primality test: Check q ∈ N through considering aq ≡ a (mod q) for random a with (a, q) = 1.
Note Euler’s aφ(m) ≡1 (mod m) is the basis of RSA public key cryptography.
Proposition 21 Let (m, m0) = 1, let x run over a complete residue system (mod m) and x0 over a complete system (mod m0). Then mx0+m0x runs over a complete system (mod mm0).
Proof. Consider the mm0 numbers mx0+m0x. If mx0+m0x ≡ my0 +m0y (mod mm0)
then
mx0 ≡ my0 (mod m0) m0x ≡ m0y (mod m)
⇒ x0 ≡ y0 (mod m0) x ≡ y (mod m)
since (m, m0) = 1. So each class is distinct. The result follows since there aremm0 classes (mod mm0).
Proposition 22 Same as before but ‘complete’ → ‘reduced’.
Proof. Claim: (mx0+m0x, mm0) = 1. If not (???) Let p∈P havep|(mx0+m0x, mm0).
If p|m then p|m0x. But (m, m0) = 1 so p - m0 hence p|x and p|(m, x) which is false (!!!). This proves the claim.
Claim: Every a ∈ Z, (a, mm0) = 1 satisfies a ≡ mx0 + m0x (mod mm0) for x, x0 with (x, m) = (x0, m0) = 1. By the above ∃x, x0 so a ≡ mx0 +m0x (mod mm0). If (x, m) = d 6= 1 then (a, m) = (mx0+m0x, m) = (m0x, m) = (x, m) = d 6= 1 which is false. Similarly (x0, m0) = 1.
By the above, the numbersmx0+m0xare incongruent. hence we have a reduced residue system of this form.
Theorem 10 φ is a multiplicative function.
Proof. If (m, m0) = 1,
φ(mm0) = #{RRS(mm0)}
= #{RRS(m)} ·#{RRS(m0)}
= φ(m)·φ(m0)