Introduction to Number Theory
MATH 365
spring, sophomore year
Divisibility
Theorem: For integers a, b, c, the following hold:
-
a∣0, 1∣a, a∣a, ±a∣±a
-
a∣1 iff a=±1
-
if a∣b and c∣d, ac∣bd
-
if a∣b and b∣c, a∣c
-
if a∣b and b∣a, a=±b
-
if a∣b and b=0, ∣a∣≤∣b∣
-
if a∣b and a∣c, a∣(bx+cy) for all x,y∈Z
if x+y=z and a divides any two of x,y,z, then a also divides the other number
GCD: for a,b∈Z, the GCD is the largest integer that divides both a and b. aka the unique integer d such that: d∣a, d∣b, and c∣a∧c∣b⟹c≤d.
well-ordered principle:
- any non-empty S⊆N has a least element
- any non-empty S⊆Z bounded above/below a greatest/least element
if gcd(a,b)=1, a and b are relatively prime (coprime).
Given a,b∈Z st b=0, there exist unique integers q and r such that a=qb+r and 0≤r<∣b∣.
Bezout’s Theorem: Let a,b∈Z such that they’re not both zero. gcd(a,b) is the smallest positive integer d that can be written in the form d=ax+by with x,y∈Z.
If c is a common divisor of a and b, c∣gcd(a,b)
Multiples of gcd(a,b) are precisely the integers of the form ax+by for x,y∈Z. In other words, ax+by=c has a solution iff gcd(a,b)∣c.
a and b are relatively prime iff there exist x,y∈Z such that ax+by=1.
If gcd(a,b)=d, gcd(da,db)=1.
If a∣b, b∣c, and gcd(a,b)=1, then ab∣c.
Euclid’s Lemma: If a∣bc and gcd(a,b)=1, then a∣c.
If p is prime and p∣ab, then p∣a∨p∣b.
gcd(a,b)=gcd(a+bq,b)
Euclid’s Algorithm: Let a,b∈Z st they’re not both zero. r−1=a, r0=b. ri+1 is the remainder of the division algorithm applied to ri−1 and ri.
Linear equation theorem: Let a,b be non-zero integers with d=gcd(a,b). ax+by=d always has an integer solution (x0,y0) which can be found using the extended Euclid’s algorithm. All other solutions are of the form (x0+kdb,y0−kda) for k∈Z.
Linear equations where solutions must be integers are called diophantine equations.
If p is prime and p∣a1a2…an, then p∣ak for some k, 1≤k≤n.
If p,q1,q2,…,qn are prime and p∣q1q2…qn, then p=qk for some k, 1≤k≤n.
Every positive integer (n>1) can be expressed as a product of primes n=p1p2…pn. This representation is unique up to the order of primes.
Any positive integer n>1 can be written canonically as n=p1a1…prar where p1<⋯<pr are prime and 0<a1,…,an.
There are infinitely many primes.
Prime Number Theorem: The function π is asymptotic to lnxx.
The proportion of primes at most n is lnn1.
Goldbach Conjecture: Every even number n≥4 can be written as the sum of two primes.
Twin Prime Conjecture: There are infinitely many primes p such that p+2 is also prime.
A pythagorean triplet is an integer solution to the equation x2+y2=z2. A pythagorean triple is called primitive if gcd(x,y,z)=1.
Modular Arithmetic
The least common multiple of a,b∈N is the smallest positive integer n such that a∣n and b∣n.
gcd(a,b)=∏primes ppmin(ap,bp)
lcm(a,b)=∏primes ppmax(ap,bp)
ab=∏pap+bp=∏pmin(ap,bp)+max(ap,bp)=gcd(a,b)⋅lcm(a,b)
For a given m∈N, two integers a,b are congruent modulo m if m∣a−b.
a≡bmodm
Every integer is congruent modulo m to precisely one integer a where 0<a<m.
The set of integers 0,1,2,…,m−1 is called the least residue system modulo m.
a1,a2,…,am is a complete residue system modulo m if every integer is congruent modulo m to precisely one of ai.
a≡bmodm iff a and b leavea the same remainder when divided by m.
Equivalence relation.
- reflexive: a≡amodm
- symmetric: if a≡bmodm, then b≡amodm
- transitive: if a≡bmodm, b≡cmodm, then a≡cmodm
for a given m∈N, a,b,c,d∈Z:
- if a≡bmodm and c≡dmodm, then a±c≡b±dmodm
- if a≡bmodm and c≡dmodm, then ac≡bdmodm
- if a≡bmodm, then a+c≡b+cmodm and ac=bcmodm.
- if a≡bmodm, then an≡bnmodm for all n∈N
If ac≡bcmodm and d=gcd(c,m), then a≡bmoddm
If gcd(c,m)=1 and ac≡bcmodm, then a≡bmodm.
If p is prime and p∤c, then ac≡bcmodp⟹a≡bmodp.
Linear Congruences
ax≡bmodm
mutually incongruent solutions
If ax≡bmodm and d=gcd(a,m):
- there exists a solution iff d∣b
- if d∣b, there are exactly d mutually incongruent solutions modulo m
- if x0 is a solution, the complete set of incongruent solutions is {x0,x0+dm,x0+d2m,…,x0+(d−1)dm}
ax≡bmodm has a unique solution modulo m iff a and m are coprime.
Let m>1, a∈Z. An integer b∈Z is an inverse of of amodm if ab≡1modm. a has an inverse modulo M iff gcd(a,m)=1.
Fermat’s Little Theorem: if p is prime and p∤a, then ap−1≡1modp
A solution to ax≡1modm is called a (multiplicative) inverse of a modulo m. a⋅a−1≡1modm. Inverses exist only if gcd(a,m)=1.
If gcd(a,m)=1, for any c∈Z, c,c+a,…,c+(m−1)a is a complete residue system. Order needn’t match up.
If gcd(a,m)≡1modm and am−1≡1modm, then m is composite.
Primality testing: if gcd(a,b)=1 and am−1≡1modm, then m is composite. Test of compositeness: converse is false. Composite numbers for which the test holds are called Carmichael numbers.
Wilson’s Theorem: p is prime iff (p−1)!≡−1modp
The Euler totient ϕ: ϕ(n)=#{a:1≤a≤n−1,gcd(a,n)=1}
Euler’s Theorem: aϕ(m)≡1modm
Chinese Remainder Theorem: Suppose m1,m2,…,mr>1 such that gcd(m1,mj)=1 for i=j. Then, for any integers a1,…,ar, the system x≡aimodmi for 1≤i≤r has a solution. Additionally, any solution is unique modulo m1⋯mr.
The Euler totient ϕ is multiplicative. if m,n∈Z+ and gcd(m,n)=1, ϕ(mn)=ϕ(m)ϕ(n).
If p is prime:
- ϕ(p)=p−1
- ϕ(p2)=p2−p
- ϕ(pk)=pk−p
ϕ(n)=np∣n∏(1−p1)
n=∑d∣nϕ(d)
RSA
-
pick two large primes p and q
-
compute ϕ(pq)=(p−1)(q−1)
-
choose an exponent e that is coprime to ϕ(pq)
-
find a d such that ed≡1(modpq)
-
public: (e,pq); private: d, p, q
-
encryption of a message w: we(modpq)
-
decryption of ciphertext we(modpq):
(we)d(modpq)≡wed(modpq)≡w1+ϕ(pq)(modpq)≡w(modpq)
For a,m∈Z st gcd(a,m)=1. The order of a is the smallest positive exponent e st ae≡1(modm). ordm(a).
ak≡1(modm) implies that ordm(a)∣k.
ordm(a)∣ϕ(m)
Let gcd(a,m)=1. ai≡aj(modm)⟺i≡j(modord(a))
a,a2,…,aord(a) are distinct modulo m.
An integer a (relatively prime to m) is called a primitive root of m if ord(a)=ϕ(m.
If a1,a2,…,aϕ(m) are the positive ints less than m and coprime to m and a is a primitive root of m, then a,a2…aϕ(m) are congruent to a1,a2,b≡ak(modm) \dots, a_{\phi(m)}$ in some order modulo m. For any integer b, b≡ak(modm) for some 1≤k≤ord(a).
If m has a primitive root, then it has exactly ϕ(ϕ(m)) primtive roots.
Suppose a is a primitive root of m. Then ak is also a primitive root of m iff gcd(k,ϕ(m))=1.
Lagrange theorem: Let p be a prime and f(x)=anxn+⋯+a0 where ai∈Z and an≡0(modp). Then f(x)≡0(modp) has at most n solutions modulo p.
If p is an odd prime divisor of n2+1, then p≡1(mod4).
If ordn(a)=k, then ordn(ah)=gcd(k,h)k
If gcd(h,ordn(a))=1, then ordn(ah)=ordn(a).
An integer n has a primitive root iff n=2,4,pk,2pk where p is an odd prime.
Let g be a primitive root of n and gcd(a,n)=1. a≡ge(modn) for some positive e. The smallest such exponent is called the index of a mod n for the base g. indg(a). Discrete logarithm.
Indices satisfy:
- ind(ab)≡ind(a)+ind(b)(modϕ(n))
- ind(ak)≡kind(a)(modϕ(n))
Theorem: Let n be an integer with a primitive root and gcd(a,n)=1. Then xk≡a(modn) has a solution iff adϕ(n)≡1(modn) has a solution where d=gcd(k,ϕ(n)). There are exactly d solutions.
Quadratic Reciprocity
There are exactly 2p−1 integers a (p∤a) that are squares modulo p. These 2p−1 integers occur as squares of 12,22,…,(2p−1)2.
If p∤a and a≡b2(modp) for some b, then we call a a quadratic residue modulo p.
If p and q are distinct odd primes, then (p/q)(q/p)=(−1)2p−1⋅2q−1
If p is an odd prime ad a is an odd integer st gcd(a,p)=1:
k=1∑2p−1⌊pka⌋≡μ(a,p)(mod2)
if 2k+1 is an odd prime, k is a power of 2.
a fermat number is a positive integer of the form Fn=2(2n)+1. if Fn is prime, we Fn is a fermat prime.
- are all fermat numbers prime? no
- are there infinitely many fermat primes? open
- are there infinitely many compositive fermat numbers? open
- are there any fermat primes Fn for n>4? open
Jacobi Symbol:
(a∣n)=(a∣p1)e1⋯(a∣pr)er
- (ab∣n)=(a∣n)(b∣n)
- (a∣mn)=(a∣m)(a∣n)
Let a,b be odd positive integers with gcd(a,b)=1.
(a∣b)={(b∣a)−(b∣a)a≡1(mod4)∨b≡1(mod4)a≡b≡3(mod4)
(2∣b)={1−1b≡1(mod8)∨b≡7(mod8)b≡3(mod8)∨b≡5(mod8)
(−1∣b)={1−1b≡1(mod4)b≡3(mod4)
Euler’s criterion doesn’t hold for the Jacobi symbol.
- if n is prime, jacobi = legendre
- if n is composite and (a∣n)=−1, then a is a NR of n
- if n is composite and (a∣n)=1, then a may or may not be a QR of n
Euler’s primality test: check if a2p−1≡±1(modp)
Diophantine Approximation
Approximate real numbers by rational numbers.
Let α be an irrational number. Then there exist infinitely many ba st ∣α−ba<2b21.
If α is irrational, the line x=α intersects infinitely many Ford circles.
Continued Fractions
the continued fraction made from [a0;a1,…,an] by cutting off the expansion after the k-th partial denominator is called the k-th convergent of the continued fraction and is denoted as Ck
an infinite continued fractino [a0,a1,…] is the real number limn→∞[a0;a1,…,an]
infinite continued fractions are irrational
all irrational numbers have infinite continued fraction expressions
distinct infinite continued fractions correspond to distinct irrational numbers
A binary integral quadratic form is a polynomial Q(x,y)=ax2+bxy+cy2. if n=Q(x,y) has a solution, we say that n is represented by Q.
representation problem: given a quadratic form Q, which integers are represented by Q?
pairs with gcd greater than one can be reduced to pairs with gcd = 1. pairs with gcd = 1 are called primitive pairs.