1.6 Number Theory

Divisibility


Definition


For integers a,b a comma b with b≠0 b is not equal to 0, b b divides a a denoted b|a b divides a if ∃k∈ℤ:a=k⁢b there exists k is a member of the integers colon a equals k b.

Properties


  • If b|a b divides a and c|d c divides d, then b⁢c|a⁢d b c divides a d

  • If b|a b divides a, then b|a+b⁢n b divides a plus b n for any n∈ℤ n is a member of the integers.

  • If b|a b divides a and b|c b divides c, then b|(a⁢x+c⁢y) b divides open paren a x plus c y close paren for all x⁢y∈ℤ x y is a member of the integers.

Greatest Common Divisor (GCD) and LCM


Definition


For a,b a comma b, the greatest common divisor gcd⁡(a,b) the gcd of open paren a comma b close paren is the largest d d such that d|a d divides a and d|b d divides b. The least common multiple lcm⁡(a,b) the lcm of open paren a comma b close paren is the smallest positive m m with a|m a divides m and b|m b divides m.

Euclidean Algorithm


Compute gcd⁡(a,b) the gcd of open paren a comma b close paren by repeated division: a=b⁢q+r a equals b q plus r, then replace (a,b)←(b,r) open paren a comma b close paren left arrow open paren b comma r close paren until remainder 0 0.

Relation


gcd⁡(a,b)⋅lcm⁡(a,b)=|a,b| the gcd of open paren a comma b close paren times the lcm of open paren a comma b close paren equals the absolute value of a comma b

Primes and Fundamental Theorem


Prime


An integer p>1 p is greater than 1 whose only positive divisors are 1 1 and p p.

Fundamental Theorem of Arithmetic


Every integer n>1 n is greater than 1 has a unique factorization into primes up to order:

n=p1e1⋯pkek n equals p sub 1 raised to the e sub 1 power dot dot dot p sub k raised to the e sub k power

Modular Arithmetic


For modulus m>0 m is greater than 0, define equivalence a≡b⁢mod⁡(m) a is identical to b mod m if m|(a-b) m divides open paren a minus b close paren. Operations respect congruence: if a≡a′ a is identical to a prime and b≡b′ b is identical to b prime then a±b≡a′±b′ a plus or minus b is identical to a prime plus or minus b prime, a⁢b≡a′⁢b′⁢mod⁡(m) a b is identical to a prime b prime mod m.

Residue Classes


The set {0,1,⋯,m-1} the set 0 comma 1 comma dot dot dot comma m minus 1 are representatives of ℤ/m⁢ℤ the integers divided by m the integers.

Euler's Totient Function


𝜙⁡(m) phi of m number of integers in {1,2,⋯,m} the set 1 comma 2 comma dot dot dot comma m relatively prime to m m. If m=∏(p)ei m equals the product of p raised to the e sub i power then

𝜙⁡(m)=m⁢∏i(1-1pi) phi of m equals m the product over i of open paren 1 minus the fraction with numerator 1 and denominator p sub i close paren

Congruences and Linear Equations


Solve a⁢x≡b⁢mod⁡(m) a x is identical to b mod m. A solution exists iff gcd⁡(a,m)|b the gcd of open paren a comma m close paren divides b

; then there are gcd⁡(a,m) the gcd of open paren a comma m close paren solutions mod m m.

Chinese Remainder Theorem


If m1,⋯,mk m sub 1 comma dot dot dot comma m sub k are pairwise coprime, the system

x≡ai⁢mod⁡(mi);i=1,⋯k x is identical to a sub i the mod of open paren m sub i close paren semicolon i equals 1 comma dot dot dot k

has a unique solution mod M=∏mi M equals the product of m sub i.

Diophantine Equations


Linear: a⁢x+b⁢y=c a x plus b y equals c has integer solutions iff gcd⁡(a,b)|c the gcd of open paren a comma b close paren divides c, general solution from one particular.