summary slides for math 342 july 26, 2019 summary slides...
TRANSCRIPT
Summary Slides for MATH 342
July 26, 2019
Summary slides based on Elementary Number
Theory and its Applications by K. Rosen and
The Theory of Numbers by I. Niven, H. Zuck-
erman, and H. Montgomery.
1
Recall the usual notation for the set of nat-
ural numbers, integers, rational numbers, real
numbers, complex numbers
N ⊆ Z ⊆ Q ⊆ R ⊆ C.
Well Ordering Property. Every nonempty set
of positive integers has a least element.
Definition. A number r ∈ R is rational if r =
p/q for some integers p, q, q 6= 0. If r is not
rational, then it is said to be irrational.
Theorem.√
2 is irrational.
2
Definition. Let x ∈ R.
1. We define [x] to be the greatest integer
less than or equal to x, called the greatest
integer in x. Note that [x] ≤ x < [x] + 1.
2. We define {x} = x − [x], called the frac-
tional part of x. Note that 0 ≤ {x} < 1.
3
The Pigeonhole Principle. For k ∈ N, a func-
tion f : {1, . . . , k + 1} → {1, . . . , k} is not one to
one.
Theorem. (Dirichlet’s Approximation Theo-
rem). If α ∈ R and n ∈ N, then there exists
a, b ∈ Z with 1 ≤ b ≤ n such that |bα− a| < 1n.
4
Definition. If a, b ∈ Z with a 6= 0, we say thata divides b, written a | b if there is a c ∈ Z suchthat b = ac. We also say in that case that a isa divisor or factor of b and b is a multiple of a.
Theorem. If a, b, c ∈ Z, a | b, b | c, then a | c.
Theorem. If a, b,m, n ∈ Z, c | a, c | b, thenc | (ma+ nb).
Theorem. If a | b, b 6= 0, then |b| ≥ |a|.
Theorem (The Division Algorithm). If a, b ∈ Zwith b > 0, then there are unique integers q
and r such that a = bq + r with 0 ≤ r < b.We call q the quotient, r the remainder, a thedividend, and b the divisor.
Definition. If the remainder when n is dividedby 2 is 0, then n = 2k for some k ∈ Z and wesay n is even, whereas if the remainder when n
is divided by 2 is 1, then n = 2k + 1 for somek ∈ Z and we say n is odd.
5
Definition. The greatest common divisor oftwo integers a and b, which are not both 0, isthe largest integer that divides a and b, and isdenoted by (a, b).
Definition. The integers a and b are relativelyprime if a and b have greatest common divisor(a, b) = 1.
Theorem. Let a and b be integers with (a, b) =d. Then (a/d, b/d) = 1.
Theorem. Let a, b, c ∈ Z. Then (a + cb, b) =(a, b).
Definition. If a and b are integers, then a linearcombination of a and b is a sum of the formma+ nb, where m,n ∈ Z.
Theorem. The greatest common divisor of theintegers a and b, not both 0, is the least pos-itive integer that is a linear combination of aand b.
6
Corollary. If a and b are relatively prime inte-
gers, then there are integers m and n such that
ma+ nb = 1.
Theorem. If a and b are integers, which are not
both 0, then the set of linear combinations of
a and b is a set of integer multiples of (a, b).
Theorem. If a and b are integers, not both 0,
then a positive integer d is the greatest com-
mon divisor of a and b if and only if
• d | a and d | b
• if c is an integer with c | a and c | b, then
c | d.
7
Definition. Let a1, . . . , an be integers, not all 0.
The greatest common divisor of these integers
is the largest integer that is a divisor of all of
the integers in the set. The greatest common
divisor of a1, . . . , an is denoted by (a1, . . . , an).
Lemma. If a1, . . . , an are integers, not all 0,
then (a1, . . . , an−1, an) = (a1, . . . , an−2, (an−1, an)).
Definition. We say that integers a1, . . . , an are
mutually relatively prime if (a1, . . . , an) = 1.
These integers are called pairwise relatively prime
if (ai, aj) = 1 for i 6= j.
8
Theorem (The Euclidean Algorithm). Let r0 =
a and r1 = b be integers such that a ≥ b > 0.
If the division algorithm is successively applied
to obtain ri = ri+1qi+1 + ri+2 with 0 < ri+2 <
ri+1 for i = 0,1,2, . . . , n−1 and rn+1 = 0, then
(a, b) = rn the last nonzero remainder.
Lemma. If e and d are integers and e = dq+ r,
where q and r are integers, then (e, d) = (d, r).
9
Theorem. Let a and b be positive integers.
Then (a, b) = xna+ynb where xn and yn are the
n-th terms of the sequences defined recursively
by
x0 = 1, y0 = 0, x1 = 0, y1 = 1
and
xi = xi−2 − qi−1xi−1, yi = yi−2 − qi−1yi−1.
10
Finite simple continued fraction expansion ofa rational number a/b.
Set r0 = a, r1 = b and apply the Euclideanalgorithm: ri = qiri+1 + ri+2 where 0 < ri+2 <
ri+1 for i = 0,1, . . . , n− 1, and rn+1 = 0.
[Note change in indices: qi+2 is now qi and i
starts at 0, not −1.]
Each step in the Euclidean algorithm expresses:ri/ri+1 = qi + ri+2/ri+1 = qi + 1
ri+1ri+2
.
The finite simple continued fraction expansionof a/b is given by [q0; q1, . . . , qn−1].
For a real irrational number α, set α0 = α, andfor k ≥ 1, let ak = [αk], and αk = ak + 1
αk+1(or
equivalently, αk+1 = 1αk−ak
).
The infinite simple continued fraction expan-sion of α is given by [a0; a1, a2, . . .].
11
Definition. A prime is an integer greater than
1 that is divisible by no positive integers other
than 1 and itself.
Definition. An integer greater than 1 that is
not prime is called composite.
Lemma. Every integer greater than 1 is a finite
product of primes.
Theorem. There are infinitely many primes.
Theorem. If n is a composite integer, then n
has a prime factor not exceeding√n.
Sieve of Erathosthenes
12
Theorem (The Fundamental Theorem of Arith-metic). Every positive integer greater than 1can be written uniquely as a product of primes,with the prime factors in the product writtenin nondecreasing order.
Lemma. If a, b, c ∈ Z and (a, b) = 1 and a | bc,then a | c.
Lemma. If p | a1 . . . an where p is a prime anda1, . . . , an ∈ Z, then p | ai for some i.
Lemma. If (a,m) = 1 and (b,m) = 1, then(ab,m) = 1.
Definition. The least common multiple of twononzero integers a and b is the smallest posi-tive integer that is divisible by a and b, and isdenoted by [a, b].
Theorem. If a and b are positive integers, then[a, b] = ab/(a, b).
13
Parity of an integer:
An integer is odd if and only if it is of the form
2k + 1 for some k ∈ Z.
An integer is even if and only if it is of the form
2k, for some k ∈ Z.
14
Theorem. Let α ∈ R be a root of a monic
polynomial with coefficients in Z. Then α ∈ Zor α is irrational.
Theorem. Let a and b be non-zero integers
with d = (a, b). The equation ax + by = c has
no integral solutions if d - c. If d | c, then there
are infinitely many integral solutions. More-
over, if x = x0, y = y0 is a particular solution
of the equation, then all solutions are given by
x = x0 + (b/d)n, y = y0 − (a/d)n.
15
Theorem. Let n ≥ 2. If a1, . . . , an are nonzero
integers, then the equation a1x1+. . .+anxn = c
has an integral solution if and only if d =
(a1, . . . , an) divides c. Furthermore, when there
is a solution, there are infinitely many solu-
tions.
Remark: Section 3.7 gives some techniques
for solving a system of linear diophantine equa-
tions in several variables. There is a systematic
method which can be found in Niven-Zuckerman-
Montgomery Section 5.2.
16
Definition. Let m be a positive integer. If a
and b are integers, we say that a is congruent
to b modulo m if m | (a − b), and write a ≡ b
(mod m).
Theorem. If a and b are integers, then a ≡ b
(mod m) if and only if there is an integer k
such that a = b+ km.
Theorem. Let m ∈ N. Congruences modulo m
satisfy the following properties.
• a ≡ a (mod m)
• a ≡ b (mod m) implies b ≡ a (mod m).
• a ≡ b (mod m), b ≡ c (mod m) implies a ≡c (mod m).
17
Theorem. If a, b, c,m ∈ Z, m > 0, and a ≡ b
(mod m) then
• a+ c ≡ b+ c (mod m)
• a− c ≡ b− c (mod m)
• ac ≡ bc (mod m).
18
Theorem. Let a, b, c, d, e, f,m ∈ Z, m > 0, (∆,m) =
1 where ∆ = ad− bc. Then the system of con-
gruences
ax+ by ≡ e (mod m)
cd+ dy ≡ f (mod m)
has a unique solution modulo m.
19
Theorem. If a, b, c,m ∈ Z, m > 0, d = (c,m),and ac ≡ bc (mod m), then a ≡ b (mod m/d).
Corollary. If a, b, c,m ∈ Z, m > 0, (c,m) = 1,and ac ≡ bc (mod m), then a ≡ b (mod m).
Definition. A complete residue system modulom is a set of integers such that every integeris congruent modulo m to exactly one integerin this set.
Lemma. A set of m incongruent integers mod-ulo m forms a complete set of residues modulom.
Theorem. If r1, . . . , rm is a complete residuesystem modulo m, and if (a,m) = 1, then ar1+b, ar2 + b, . . . , arm + b is a complete system ofresidues modulo m for any integer b.
Theorem. If a, b, k,m ∈ Z, k > 0, m > 0, anda ≡ b (mod m), then ak ≡ bk (mod m).
20
Theorem. If
a ≡ b (mod m1), . . . , a ≡ b (mod mk),
where a, b,m1,m2, . . . ,mk ∈ Z then
a ≡ b (mod [m1,m2, . . . ,mk]).
Corollary. If
a ≡ b (mod m1), . . . , a ≡ b (mod mk),
where a and b are integers, and m1, . . . ,mk are
pairwise relatively prime integers, then
a ≡ b (mod m1 . . .mk).
Theorem. Let a, b,m ∈ Z, m > 0 and (a,m) =
d. If d - b, then ax ≡ b (mod m) has no solu-
tions. If d | b, then ax ≡ b (mod m) has exactly
d incongruent solutions modulo m.
Corollary. If a and m are relatively prime in-
tegers with m > 0 and b an integer, then the
linear congruence ax ≡ b (mod m) has a unique
solution.
Definition. Given an integer a with (a,m) =
1, a solution of ax ≡ 1 (mod m) is called an
inverse of a modulo m.
Theorem. Let p be prime. The positive integer
a is its own inverse modulo p if and only if a ≡ 1
(mod p) or a ≡ −1 (mod p).
21
Digression into abstract algebra (not part of
course material)
A group G is a set with a binary composition
law such that
1. For all a, b, c ∈ G, (ab)c = a(bc).
2. There is an element e ∈ G such that ae =
ea = a for all a ∈ G.
3. For each a ∈ G, there is an b ∈ G such that
ab = ba = e.
The identity element e is unique.
The inverse element b of a is unique, denoted
a−1.
22
A group G is said to be commutative or abelian
if xy = yx for all x, y ∈ G.
Sometimes we denote compositions additively
as the sum x+ y when the group G is abelian.
In that case, we denote the identity element
as zero 0 and inverses as negatives −x.
A group G is said to be commutative or abelian
if xy = yx for all x, y ∈ G.
A field K is a non-empty set with two compo-
sitions laws, addition and multiplication such
that
1. K is an abelian group under addition (0
is additive identity, negation is additive in-
verse)
2. 0x = x0 = 0 for all x ∈ K
3. K∗ = K − {0} is an abelian group under
multiplication (1 is multiplicative identity,
reciprocal is multiplicative inverse)
4. x(y + z) = xy + yz for all x, y, z ∈ K
It is automatic that 0 6= 1, (x + y)z = xz + yz
for all x, y, z ∈ K, 1x = x = x1 for all x ∈ K.
A ring R is a non-empty set with two compo-
sitions laws, addition and multiplication such
that
1. R is an abelian group under addition
2. (xy)z = x(yz) for all x, y, z ∈ R
3. x(y + z) = xy + xz for all x, y, z ∈ R
4. (x+ y)z = xz + yz for all x, y, z ∈ R
The identity element of addition is denoted by
zero 0.
It follows that 0x = 0 = x0 for all x ∈ R.
The properties for congruences imply:
Z/mZ is a ring
Z/pZ is a field for p prime
Z/mZ under + is an abelian group
(Z/mZ)× under · is an abelian group
Theorem (Wilson’s Theorem). If p is prime,
then (p− 1)! ≡ −1 (mod p).
Theorem. If n ≥ 2 is an integer such that
(n− 1)! ≡ −1 (mod n), then n is prime.
Theorem (Fermat’s Little Theorem). If p is
prime and a is an integer with p - a, then ap−1 ≡1 (mod p).
Theorem. If p is prime then ap ≡ a (mod p).
Theorem. If p is prime and a is an integer such
that p - a, then ap−2 is an inverse of a modulo
p.
Corollary. If a and b are positive integers and
p is prime with p - a, then the solutions of
the linear congruence ax ≡ b (mod p) are the
integers x such that x = ap−2b (mod p).
23
Definition. Let n be a positive integer. The
Euler φ function φ(n) is defined to be the num-
ber of positive integers not exceeding n that
are relatively prime to n.
Definition. A reduced residue system modulo
n is a set of φ(n) integers such that each ele-
ment of the set is relatively prime to n, and no
two different elements of the set are congruent
modulo n.
Theorem. If r1, . . . , rφ(n) is a reduced residue
system modulo n, and if a is a positive integer
with (a, n) = 1, then the set ar1, . . . , arφ(n) is
also a reduced residue system modulo n.
Theorem (Euler’s Theorem). If m is a positive
integer and a is an integer with (a,m) = 1,
then aφ(m) ≡ 1 (mod m).
24
Theorem (The Chinese Remainder Theorem).
Let m1, . . . ,mr be pairwise relatively prime pos-
itive integers. Then the system of congruences
x ≡ a1 (mod m1)
x ≡ a2 (mod m2)
. . . . . .
x ≡ ar (mod mr)
has a unique solution modulo M = m1 . . .mr.
25
Theorem. Let b,m, n are positive integers such
that b < m. Then the least positive residue of
bN modulo m can be computed using
O((log2m)2 log2N)
bit operations.
26
Definition. Let b be a positive integer. If n
is a composite positive integer and bn−1 ≡ 1
(mod n), then n is called a pseudoprime to the
base b.
Lemma. If d and n are positive integers such
that d | n, then 2d − 1 divides 2n − 1.
Theorem. There are infinitely many pseudo-
primes to the base 2.
Definition. A composite number n that satis-
fies bn−1 ≡ 1 (mod n) for all positive integers
b with (b, n) = 1 is called a Carmichael number
or absolute pseudoprime.
Theorem. If n = q1 . . . qk where qj are distinct
prime numbers that satisfy (qj−1) | (n−1) for
all j and k > 2, then n is a Carmichael number.
27
Primitive Factorization Methods
1. Trial division.
2. Fermat factorization method.
3. Pollard p− 1 factorization method.
(see Screencast 2: Primitive Factorization Meth-
ods)
28
Definition. An arithmetic function is a functionthat is defined for all positive integers.
Definition. An arithmetic function f is calledmultiplicative if f(mn) = f(m)f(n) wheneverm and n are relatively prime positive integers.It is called completely multiplicative if f(mn) =f(m)f(n) for all positive integers m and n.
Theorem. If f is a multiplicative function and ifn = p
a11 . . . pass is the prime power factorization
of n, then f(n) = f(pa11 ) . . . f(pass ).
Theorem. If p is prime, then φ(p) = p − 1.Conversely, if p is a positive integer with φ(p) =p− 1, then p is prime.
Theorem. Let p be a prime and a a positiveinteger. Then φ(pa) = pa − pa−1.
Theorem. Let m and n be relatively primepositive integers. Then φ(mn) = φ(m)φ(n).
29
Theorem. Let n = pa11 . . . p
akk be the prime
power factorization of the positive integer n.
Then
φ(n) = n
(1−
1
p1
). . .
(1−
1
pk
).
Theorem. Let n be a positive integer greater
than 2. Then φ(n) is even.
Theorem. Let n be a positive integer. Then∑d|n
φ(d) = n.
Definition. The sum of divisors function, de-
noted by σ, is defined by setting σ(n) equal to
the sum of all positive divisors of n.
Definition. The number of divisors function,
denoted by τ , is defined by setting τ(n) equal
to the number of positive divisors of n.
30
Theorem. If f is a multiplicative function, then
the summatory function of f , namely F (n) =∑d|n f(d) is also multiplicative.
Corollary. The sum of divisors function σ and
the number of divisors function τ are multi-
plicative functions.
Lemma. Let p be prime and a a positive inte-
ger. Then
σ(pa) = 1 + p+ p2 + . . .+ pa =pa+1 − 1
p− 1
and
τ(pa) = a+ 1.
31
Theorem. Let the positive integer n have primefactorization n = p
a11 . . . pass . Then
σ(n) =pa1+11 − 1
p1 − 1. . .
pas+1s − 1
ps − 1,
and
τ(n) = (a1 + 1) . . . (as + 1).
Definition. If n is a positive integer and σ(n) =2n, then n is called a perfect number.
Theorem. The positive integer n is an evenperfect number if and only if n = 2m−1(2m−1)and 2m − 1 is prime.
Theorem. If m is a positive integer and 2m−1is prime, then m must be prime.
Definition. If m is a positive integer, thenMm = 2m−1 is called the mth Mersenne num-ber. If p is prime and Mp = 2p − 1 is prime,then Mp is called a Mersenne prime.
32
Theorem. If p is an odd prime, then any divisor
of the Mersenne number Mp = 2p− 1 is of the
form 2kp+ 1, where k is a positive integer.
Definition. A positive integer n is squarefree ifn > 1 and there is no prime p such that p2 | n.
Definition. The Mobius function µ(n) is de-fined by
µ(n) =
1 if n = 1
(−1)r if n = p1 . . . pr is squarefree
0 otherwise
.
Lemma. Let m and n are relatively prime pos-itive integers. Then if d is a positive divisor ofmn, there is a unique pair of positive divisorsd1 of m and d2 of n such that d = d1d2. Con-versely, if d1 and d2 are positive divisors of mand n, respectively, then d = d1d2 is a positivedivisor of mn.
Theorem. The Mobius function µ(n) is a mul-tiplicative function.
Theorem. The summatory function of the Mobiusfunction at the integer n, F (n) =
∑d|n µ(d) sat-
isfies F (n) = 1 if n = 1 and F (n) = 0 if n > 1.
33
Theorem (The Mobius Inversion Formula). Sup-
pose that f is an arithmetic function and that
F is the summatory function of f so that F (n) =∑d|n f(d). Then for all positive integers n,
f(n) =∑d|n µ(d)F (n/d).
Theorem. Let f be an arithmetic function with
summatory function F . Then if F is a multi-
plicative, f is also multiplicative.
34
Definition. Let a and n be relatively prime
integers. Then the least positive integer x such
that ax ≡ 1 (mod n) is called the order of a
modulo n, denoted ordna.
Theorem. If a and n are relatively prime inte-
gers with n > 0, then the positive integer x is
a solution of the congruence ax ≡ 1 (mod n)
if and only if ordna | x.
Corollary. If a and n are relatively prime inte-
gers with n > 0, then ordna | φ(n).
Theorem. If a and n are relatively prime inte-
gers with n > 0, then ai ≡ aj (mod n), where
i and j are nonnegative integers, if and only if
i ≡ j (mod ordna).
Definition. If r and n are relatively prime inte-
gers with n > 0 and if ordnr = φ(n), then r is
a primitive root modulo n.
35
Theorem. If r and n are relatively prime posi-
tive integers and if r is a primitive root modulo
n, then the integers r1, r2, . . . , rφ(n) form a re-
duced residue set modulo n.
Theorem. If ordna = t and if u is a positive
integer, then ordn(au) = t/(t, u).
Corollary. Let r be a primitive root modulo n,
where n is an integer, n > 1. Then ru is a prim-
itive root modulo n if and only if (u, φ(n)) = 1.
Theorem. If the positive integer n has a prim-
itive root, then it has a total of φ(φ(n)) incon-
gruent primitive roots.
36
Theorem (Lagrange’s Theorem). Let f ∈ Z[x]be a polynomial of degree n ≥ 1 with leadingcoefficient an not divisible by p a prime. Thenf has at most n incongruent roots modulo p.
Theorem. Let p be prime and let d be a divisorof p−1. Then the polynomial xd−1 has exactlyd incongruent roots modulo p.
Lemma. Let p be a prime and let d be a posi-tive divisor of p− 1. Then the number of pos-itive integers less than p of order d modulo pdoes not exceed φ(d).
Theorem. Let p be a prime and let d be apositive divisor of p − 1. Then the numberof incongruent integers of order d modulo p isequal to φ(d).
Corollary. Every prime has a primitive root.
Artin’s Conjecture. The integer a is a primitiveroot of infinitely many primes if a 6= ±1 and ais not a perfect square.
37
Theorem. If p is an odd prime with primitive
root r, then either r or r+p is a primitive root
modulo p2.
Theorem. Let p be an odd prime. Then pk
has a primitive root for all positive integers k.
Moreover, if r is a primitive root modulo p2,
then r is a primitive root modulo pk for all
positive integers k.
Theorem. If a is an odd integer, and if k ≥ 3
is an integer, then
aφ(2k)/2 = a2k−2≡ 1 (mod 2k).
Theorem. If n is a positive integer that is not
a prime power or twice a prime power, then n
does not have a primitive root.
Theorem. If p is an odd prime and t is a
positive integer, then 2pt possesses a primitive
38
root. In fact, if r is a primitive root modulo
pt, then if r is odd, it is also a primitive root
modulo 2pt; whereas if r is even, r + pt is a
primitive root modulo 2pt.
Theorem. The positive integer n > 1 possesses
a primitive root if and only if n = 2,4, pt,2pt
where p is an odd prime and t ∈ N.
Definition. Let m be a positive integer with
primitive root r. If a is a positive integer with
(a,m) = 1, then the unique integer x with 1 ≤x ≤ φ(m) and rx ≡ a (mod m) is called the
index or discrete logarithm of a to the base r
modulo m, denote indra.
Theorem. Let m be a positive integer with
primitive root r and let a and b be integers
relatively prime to m. Then
• indr1 = 0 (mod φ(m))
• indrab ≡ indra+ indrb (mod φ(m))
• indrak ≡ k · indra (mod φ(m)).
Theorem. Let m be a positive integer with a
primitive root. If k is a positive integer and
39
a is an integer relatively prime to m, then the
congruence xk ≡ a (mod m) has a solution if
and only if aφ(m)/d ≡ 1 (mod m) where d =
(k, φ(m)).
Theorem (Dirichlet’s Theorem on Primes inArithmetic Progressions). Suppose that a, b ∈N are not divisible by the same prime. Thenthe arithmetic progression an+b, n = 1,2,3, . . .contains infinitely many primes.
Definition. Let x ∈ R. Define π(x) to be thenumber of prime numbers ≤ x.
Theorem (The Prime Number Theorem). Theratio of π(x) to x/ logx approaches 1 as x
grows without bound.
Corollary. Let pn denote the nth prime, whenn ∈ N. Then pn ∼ n logn.
Theorem. For any positive integer n, thereare at least n consecutive composite positiveintegers.
Theorem (Bertrand’s Postulate) For every pos-itive integer n > 1, there is a prime p such thatn < p < 2n.
40
Theorem (Chebychev)
Let a < a0 = 13 log 2, b > b0 = 3
2a0. Then there
exists an x0 such that
ax
logx< π(x) < b
x
logx
for all x ≥ x0.
41
The Twin Prime Conjecture. There are in-
finitely many pairs of primes p and p+ 2.
Goldbach’s Conjecture. Every even positive in-
teger greater than 2 is the sum of two primes.
The n2 + 1 Conjecture. There are infinitely
many primes of the form n2 + 1, where n is a
positive integer.
42
Definition. If m is a positive integer, we say
that the integer a is a quadratic residue of
m if (a,m) = 1 and the congruence x2 ≡ a
(mod m) has a solution. If (a,m) = 1 and the
congruence x2 ≡ a (mod m) has no solution,
we say that a is a quadratic nonresidue of m.
Lemma. Let p be an odd prime and a and
integer not divisible by p. Then, the congru-
ence x2 ≡ a (mod p) has either no solutions or
exactly two incongruent solutions modulo p.
Theorem. If p is an odd prime, then there are
exactly (p − 1)/2 quadratic residues of p and
(p−1)/2 quadratic nonresidues of p among the
integers 1,2, . . . , p− 1.
43
Theorem. Let p be a prime and let r be a prim-
itive root of p. If a is an integer not divisible
by p, then a is a quadratic residue of p if indra
is even and a is a quadratic nonresidue of p if
indra is odd.
Definition. Let p be an odd prime and a be an
integer no divisible by p. The Legendre symbol(ap
)is defined by
(a
p
)=
1 if a is a quadratic residue of p
−1 if a is a quadratic nonresidue of p
Theorem (Euler’s Criterion). Let p be an odd
prime and let a be a positive integer not divis-
ible by p. Then(a
p
)≡ a(p−1)/2 (mod p).
44
Theorem. Let p be an odd prime and a and b
be integers not divisible by p. Then
• if a ≡ b (mod p), then(ap
)=(bp
)
•(ap
) (bp
)=(abp
)
•(a2
p
)= 1
Theorem. If p is an odd prime, then(−1
p
)=
1 if p ≡ 1 (mod 4)
−1 if p ≡ −1 (mod 4).
45
Lemma (Gauss’ Lemma). Let p be an odd
prime and a an integer with (a, p) = 1. If s
is the number of least positive residues of the
integers a,2a,3a, . . . , p−12 a that are greater than
p/2, then(ap
)= (−1)s.
Theorem. If p is an odd prime, then(
2p
)=
(−1)(p2−1)/8.
Theorem (The Law of Quadratic Reciprocity).
Let p and q be distinct odd primes. Then(p
q
)(q
p
)= (−1)
p−12
q−12 .
Lemma. If p is an odd prime and a is an odd
integer not divisible by p, then(ap
)= (−1)T (a,p)
where T (a, p) =∑(p−1)/2j=1 [ja/p].
46
Definition. Let n be an odd positive integerwith prime factorization n = p
t11 . . . ptmm and let
a be an integer relatively prime to n. Then,the Jacobi symbol
(an
)is defined by
(a
n
)=
(a
p1
)t1. . .
(a
pm
)tm.
Theorem. Let n be an odd positive integerand let a and b be integers relatively prime ton. Then
• if a ≡ b (mod n), then(an
)=(bn
)
•(abn
)=(an
) (bn
)
•(−1n
)= (−1)(n−1)/2
•(
2n
)= (−1)(n2−1)/8.
47
Theorem (The Reciprocity Law for Jacobi Sym-
bols). Let n and m be relatively prime odd pos-
itive integers. Then(nm
) (mn
)= (−1)
m−12
n−12 .
Let R0 = a and R1 = b. Using the division
algorithm and factoring out the highest power
of two dividing the remainders, we obtain
R1 = R2q2 + 2s2R3
R2 = R3q3 + 2s3R4
. . .
Rn−2 = Rn−1qn−1 + 2sn−1 · 1,
where sj is a nonnegative integer and Rj is
an odd positive integer less than Rj−1 for j =
2,3, . . . , n− 1.
48
Theorem. Let a and b be positive integers with
a > b. Then(a
b
)= (−1)w
w = s1R2
1 − 1
8+ . . .+ sn−1
R2n−1 − 1
8
+R1 − 1
2
R2 − 1
2+ . . .+
Rn−2 − 1
2
Rn−1 − 1
2.
Remark: see examples in class and the text-
book on how to calculate Jacobi symbols in
practice.
Corollary. Let a and b be relatively prime posi-
tive integers with a > b. Then the Jacobi sym-
bol(ab
)can be evaluated using O((log2 b)
3) bit
operations.
49
Theorem. If p is a prime, not of the form
4k + 3, then there are integers x and y such
that x2 + y2 = p.
Theorem. Every solution to x2 + y2 = z2 with
x, y, z positive integers, (x, y, z) = 1 , x odd,
y even is given by x = m2 − n2, y = 2mn, z =
m2+n2, where (m,n) = 1 and m 6≡ n (mod 2).
Theorem. The equation x4 + y4 = z2 has no
solutions in non-zero integers x, y, z.
50
Theorem. If m and n are both sums of two
squares, then mn is also the sum of two squares.
Theorem. If p is a prime, not of the form
4k + 3, then there are integers x and y such
that x2 + y2 = p.
Theorem. The positive integer n is the sum of
two squares if and only if each prime factor of
n of the form 4k + 3 occurs to an even power
in the prime factorization of n.
Theorem. The positive integer n is the sum of
two coprime squares if and only if each prime
factor of n is of the form 4k+1 or is the prime
2 which occurs to at most a first power.
Theorem. If m and n are positive integers that
are each the sum of four squares, then mn is
also the some of four squares.
51
Theorem. Let p be a prime. Then p is the sum
of the squares of four integers.
Theorem. Every positive integer is the sum of
the squares of four integers.
For material on ad hoc methods for solving dio-
phantine equations, see Section 5.4 in Niven-
Zuckerman-Montgomery.
Theorem. (Hasse’s Theorem). Let a, b, c be
nonzero integers such that the product abc is
square free. Necessary and sufficient condi-
tions that ax2 + by2 + cz2 = 0 have a solution
in integers x, y, z, not all zero, are that a, b, c do
not have the same sign, and that −bc,−ac,−abare quadratic residues modulo a, b, c, respec-
tively.
52
A finite continued fraction is an expression of
the form
[a0; a1, a2, . . . , an] = a0+1
a1 +1
a2 +1
... +1
an−1 +1
an
where the a1, a2, . . . , an are positive real num-
bers, called the partial quotients of the contin-
ued fraction.
If the a1, a2, . . . , an are positive integers, then
we say the expression is a finite simple contin-
ued fraction.
An infinite (simple) continued fraction is a se-
quence of finite (simple) continued fractions
[a0; a1, a2, . . . , an]
as n→∞.53
Theorem. Let α = a0 be a real number and
define the sequence a0, a1, a2, . . . of integers re-
cursively by
ak = [αk]
αk+1 = 1/(αk − ak)
for k = 0,1,2, . . .
If for some n we have an = αn, then α =
[a0; a1, . . . , an] is a finite simple continued frac-
tion. This happens if and only if α is rational.
Otherwise α is irrational and the infinite simple
continued fraction [a0; a1, a2, . . . , an] converges
to α as n→∞.
54
Definition. The continued fraction
[a0; a1, a2, . . . ak],
is called the kth convergent of the continued
fraction [a0; a1, a2, . . .]. The kth convergent is
denoted by Ck.
Theorem. Let a0, a1, a2, . . . be real numbers
with a1, a2, . . . positive. Let the sequences p0, p1, . . .
and q0, q1, . . . be defined recursively by
p0 = a0, q0 = 1
p1 = a0a1 + 1, q1 = a1
pk = akpk−1 + pk−2, qk = akqk−1 + qk−2,
for k = 2,3, . . . , n. Then the kth convergent
Ck = [a0; a1, . . . , ak] of the continued fraction
[a0; a1, a2, . . .] is given by pk/qk.
55
Proposition. Let a0, a1, . . . be a sequence of
numbers. For all k ∈ N, we have that(a0 11 0
)(a1 11 0
). . .
(ak 11 0
)=
(pk pk−1qk qk−1
)if and only if
pkqk
= [a0; a1, . . . , ak]
pkqk
= [a0; a1, . . . , ak] is the kth partial conver-
gent of the continued fraction [a0; a1, . . .]
Taking determinants we obtain
pkqk−1 − pk−1qk = (−1)k+1 orpkqk
=pk−1
qk−1+ (−1)k−1 1
qk−1qk.
56
Definition. Let α ∈ R be irrational. A best ra-
tional approximation to α is a rational number
r/s (s > 0) such that∣∣α− r′/s′∣∣ < |α− r/s| for
some rational r′/s′ implies s′ > s.
Theorem. If α ∈ R is an irrational number,
then |α− pk/qk| < 1/q2k where Ck = pk/qk is the
kth convergent of α.
Theorem. Let α ∈ R be an irrational number.
Then the k-th convergent Ck = pk/qk is a best
rational approximation to α.
57
Theorem. If α is an irrational number and if
r/s is a rational number in lowest terms, where
r and s > 0 are integers such that
|α− r/s| <1
2s2,
then r/s is a convergent of the simple contin-
ued fraction expansion of α.
Theorem. Let d > 0 and n be integers where
d is not a perfect square and |n| <√d. If x2 −
dy2 = n, then x/y is a convergent of the simple
continued fraction of√d.
58
Theorem. (Lagrange’s Theorem) The infinite
simple continued fraction of an irrational num-
ber is periodic if and only if this number is a
quadratic irrational.
Theorem. Let d > 0 be an integer which is not
a perfect square. Define
αk = (Pk +√d)/Qk
ak = [αk]
Pk+1 = akQk − PkQk+1 = (d− P2
k+1)/Qk
for k = 0,1,2, . . ., where α0 =√d. Let pk/qk
denote the kth convergent of the simple con-
tinued fraction expansion of√d. Then
p2k − dq
2k = (−1)k−1Qk+1.
59
Theorem. Let d > 0 be an integer which is
not a perfect square. Let pk/qk denote the kth
convergent of the simple continued fraction of√d for k ∈ N, and let n be the period length of
this continued fraction.
If n is even, then the positive solutions of the
diophantine equation x2 − dy2 = 1 are
x = pjn−1, y = qjn−1
for j ∈ N and x2 − dy2 = −1 has no solution.
If n is odd, the positive solutions of the dio-
phantine equation x2 − dy2 = 1 are
x = p2jn−1, y = q2jn−1
for j ∈ N, and the positive solutions of x2 −dy2 = −1 are
x = p(2j−1)n−1, y = q(2j−1)n−1
for j ∈ N.
60
Definition. A number α ∈ C is algebraic (over
Q) if it is the root of a non-zero polynomial
with rational coefficients. The number α is
called transcendental (over Q) if it is not alge-
braic (over Q).
Theorem (Liouville). Let α ∈ R be a root of an
irreducible polynomial in Z[X] of degree d > 1.
Then there exists a constant C = C(α) > 0
such that
|α− p/q| > C(α)/qd
for all rational numbers p/q(q > 0).
Theorem. The real number α =∑∞i=1
110i!
is
transcendental over Q.
61