Some Elementary Number Theory

Bézout's Identity and The Euclidean Algorithm

Theorem:

Let $\QTR{Large}{a}$ and $\QTR{Large}{b}$ be two integers. Let MATH , the greatest common divisor of $\QTR{Large}{a}$ and $\QTR{Large}{b}$ . We can find integers $\QTR{Large}{i}$ and $\QTR{Large}{j}$ and such that

MATH

Proof:

By reordering if necessary, we can assume MATHand MATH since,

Let MATHbe the smallest integer such that there are integers $\QTR{Large}{i}$ and $\QTR{Large}{j}$ and MATH.

We need to show MATH

$\QTR{Large}{c\ }$is a common divisor of $\QTR{Large}{a}$ and $\QTR{Large}{b}$ . If not, assume it does not divide $\QTR{Large}{a}$ ( $\QTR{Large}{c}\ $does not divide $\QTR{Large}{b}$ is essentially the same argument) , we have MATH with MATH

So

MATH

and

MATH

On the other hand, If $\QTR{Large}{d\ }$is a common divisor of $\QTR{Large}{a}$ and $\QTR{Large}{b}$ then $\QTR{Large}{d\ }$divides $\QTR{Large}{c}$ . Since MATH

Therefore $\QTR{Large}{c}$ is the greatest common divisor

The Algorithm:

Again assume MATH, if $\QTR{Large}{b\ }$divides $\QTR{Large}{a}$ we are done since MATH. If not letMATHwith MATH.MATH

If MATHdivides $\QTR{Large}{b\ }$, it must also divide $\QTR{Large}{a\ }$ , so let MATH , and MATH

Suppose MATHdoes not divide $\QTR{Large}{b\ }$then MATH with MATH .

If MATHdivides MATH, as before, it also divides $\QTR{Large}{b}$ and hence $\QTR{Large}{a}$. By back substitution

MATH

MATH

MATH

Suppose MATHdoes not divide MATHthen MATH with MATH and so on. The process must terminiate in a finite number of steps.MATH

Corrollary:

In the setting above, again assuming MATHwe can select $\QTR{Large}{\ j}$ such that MATH

Proof: Exercise. If MATH,begin by finding an $\QTR{Large}{n\ }$and MATH such that MATH

__________________________________________________________________________________________

Prime Numbers:

Definition:

Let $\QTR{Large}{a}$ and $\QTR{Large}{b\ }$ be two integers such that $\QTR{Large}{|a|}$ $\QTR{Large}{>0}$ , MATH ,and MATH then $\QTR{Large}{a}$ and $\QTR{Large}{b}$ are said to be relatively primeMATH

Theorem:

Let $\QTR{Large}{a}$ and $\QTR{Large}{b\ }$be relatively prime Let $\QTR{Large}{p}$ be a prime such that $\QTR{Large}{p}$ divides MATH . Then divides $\QTR{Large}{p}$ divides $\QTR{Large}{a}$ or $\QTR{Large}{p}$ divides $\QTR{Large}{b}$
.

Proof:

Suppose $\QTR{Large}{p}$ does not divide $\QTR{Large}{a}$ , then we can find $\QTR{Large}{i\ }$and$\QTR{Large}{\ j}$ such that MATH

Multiplying both sides of the equation by $\QTR{Large}{b}$, we have MATH

Since $\QTR{Large}{p}$ divides both terms on the left side of the equation, $\QTR{Large}{p}$ divides MATH

Theorem:

Every integer $\QTR{Large}{a\ }$such that $\QTR{Large}{|a|}$ $\QTR{Large}{>1}$ can be uniquely factored into a product of primes (perhaps times $\QTR{Large}{-1}$)MATH

Proof:

First show by an inductive argument that every such integer is either a prime or a product of primes. Then use the previous Theorem to show that the product is unique.



Godel Numbers - An Example:

encode a sequence of letters ,again as numbers, MATH as a single integer MATH . Because of unique factorization we can recover the original sequence.

_____________________________________________________________________________________________

The Integers mod n:

Below, sometime our calculations will be in MATH and sometimes in the integers $\QTR{Large}{Z}$ . Hopefully, use of the phases " In MATH " and " In $\QTR{Large}{Z\ }$" will clarify where the computations are taking place

and the conclusions that can be draw::

Some Examples

  1. In MATHthe equation $\QTR{Large}{a+}$ MATH is uniquely solvable for $\QTR{Large}{x\ }$and therefore, in MATH , we can also define the operation $\QTR{Large}{b\ -}$ $\QTR{Large}{a}$.

    If MATH then, in MATH , the solution to the equation $\QTR{Large}{5-}$ MATH is MATH:

  2. In MATH in general the equation MATH MATHis not solvable, however: If $\QTR{Large}{a\ }$ and $\QTR{Large}{n\ }$are relatively prime, as Integers then there is a unique MATHwith MATH In $\QTR{Large}{Z\ ,}$just solve MATH , in particular MATHIn MATHlet MATH

    Exercise: We are assuming that, in MATHlet MATH " makes sense in terms of existance and, uniqueness, why?:

  3. MATH and MATH , as Integers, then in MATH the equation MATH MATHis uniquely solvable

_________________________________________________________________________________________

Affine Encryption (in MATH:

Choose MATH with MATH,$\QTR{Large}{a>1,}$ as Integers.

Representing the letters of the alphabet (A,B,....,Z) as MATH and looking at MATH with MATH,$\QTR{Large}{a>1,}$ as Integers,

Advantages: It is easy to compute and slightly better than the Caesar Cyper in that there are $\QTR{Large}{25}$ choices for $\QTR{Large}{s}$ and $\QTR{Large}{11\ }$choices for $\QTR{Large}{a}$ (not MATH) or (MATH. That is $\QTR{Large}{275}$ possible codes.

Disadvantages: It is really just a Substitution Cypher!

Plan B: Encode the entire MATH character ASCII table, and look at MATH with MATH ,$\QTR{Large}{a>1,}$ as Integers.you would want to do this anyway. Still easy to compute and now there are approximately MATHpossible codes. A bit harder but still subject to frequency analysis attacks.

Plan C: Use Affine Encryption to encode data in 4 byte blocks say, using MATHYou could encode text 4 characters at a time.

_____________________________________________________________________________________

The Fermat--Euler Theorem:

Definition: Let MATH be the number of members of MATHrelatively prime to $\QTR{Large}{n\ }$, as integers.

MATHis called the Euler Totient Function.

  1. If $\QTR{Large}{n}$ is a prime then MATH

  2. If MATH where $\QTR{Large}{p}$ $\QTR{Large}{\neq }$ $\QTR{Large}{q}$ are primes then MATH.


Theorem: Let MATH , then MATH

Proof: (Unless otherwise noted all calculations will be in In MATH)

We can assume MATH (MATH ) since if MATH, and MATHthen MATHand MATH

Let MATHbe the subset of members relatively prime to $\QTR{Large}{n}$.

Since the MATH have multiplicative inverses, one verifies that MATH

So

$\QTR{Large}{\ }$MATH

MATH

____________________________________________________________________________________

The Chinese Remainder Theorem ( Wikipedia):

Theorem: Suppose MATHare pairwise relatively prime positive integers, MATH and MATH Suppose MATHare integers. Then the system of simultaneous equations

MATH

has a unique solution MATH , where MATH

Proof: Let MATH and MATH MATH MATH , this is well defined MATH since MATH

MATH

Exercise 1: Show $\QTR{Large}{x}$ is a solution and is unique MATH

Exercise 2: Let MATH , MATH , MATH , MATH solve the simultaneous equations:

MATH

MATH

MATH