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}$ essentially the same argument) , we have MATH with MATH

And so

MATH

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 MATHSo 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.


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.

Corrollary:

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

Proof: Exercise.

_____________________________________________________________________________________________

The Integers mod n:

A Convention:

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 MATHExercise: 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:

Affine Encryption: Choose MATH with MATH, as Integers

Focusing on the letters of the alphabet (A,B,....,Z) and looking at MATH with MATH

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}{22}$choices for $\QTR{Large}{a}$ (not MATH or $\QTR{Large}{13}$).

That is $\QTR{Large}{550}$ possible codes.

Disadvantages: It is just a Substitution Cypher!



Plan B: Encode the entire MATH character ASCII table, and look at MATH with MATH 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 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