A Bit of Number Theory
Fundamental Lemma of Number Theory: Let be two integers. There exits unique integers and with and
Note: Uniqueness follows from the fact that implies
Definition: Let be two integers. The greatest common divisor of and is defined to be largest integer such that
divides both and .
Notation .
Since divides both and , we can use induction to show that exists. For that matter, since one can compute (very inefficiently!) by
trying all values, starting at and ending at the least of and
Examples: .
Lemma: Suppose then .
PROOF: In fact all of their common divisors are in common!
The Euclidean Algorithm for computing : (See the proof below)
Theorem( Extended Euclidean Algorithm): Let There exists integers and , computable using the Euclidean Algorithm such that
PROOF: (By induction)
If the theorem is trivial so for simplicity assume that . Again if divides the theorem is trivial so assume
hence
If divides then and .
Otherwise
hence and
or again if divides we are done else......
Example- Compute
Computing the simple-minded way requires long divisions. Divide and by through .
Now by the euclidean algorithm,
This admittedly is an easy example but we see that EA requires long divisions to find .
Lemma: Suppose is prime (the only divisors are and ). Suppose divides then divides or divides .
PROOF: Suppose does not divide , then . Thus there exists integers and , such that
Multiplying both sides of the equation by gives
Since both terms on the left hand side are divisible by so is the right hand side.
Simple Observation: Let and be primes. Let . The only divisors of are , , and .
A Big Question: Suppose I know that is the product of two primes and . How hard is it to compute this primes? Again there is a simple-minded answer. . Hence we only have to do at most long divisions.
Suppose has digits, how long might that take?