Lecture 2: An Introduction to Number Theory

Prime Numbers

**Theorem** [Fundamental Theorem of Arithmetic]:
Every positive integer is uniquely a product of prime numbers.

Of course, given a number , a prime can appear on its list more than once. For instance, the number

Much later on, we will see that factoring a number into its prime factors is extremely difficult and plays an important role in cryptology. But first, we continue to study our prime numbers.

We know that there are infinitely many numbers. And we know that each can be written uniquely as a product of primes. So it seems that there must be quite a few prime numbers. However, is it possible that only finitely many prime numbers could generate all of the numbers? The answer to this question goes back to Euclid.

**Theorem:** There are infinitely many prime numbers.

*Proof:* Suppose that there were only finitely many prime
numbers. Then, we could write them all down in a list, . Consider now the number

It is necessarily larger than any of the primes on our list, and so therefore is not prime. But, from the Fundamental Theorem of Arithmetic, it has a prime factorization. This means, in particular, that it is divisible by one of the primes on our list. This cannot be the case however, since our number divided by any prime on our list give remainder 1. Thus, our list is incomplete and there are infinitely many primes.

Greatest Common Divisors

For example, . We will see in a moment
that greatest common divisors exist for any two positive integers and . If and are such that , then we say that and are
*relatively prime*. For example, 8 and 15 are relatively prime.
This terminology comes from the fact that they have no common proper
divisor other than 1; much like how a prime number has no proper
divisor other than 1.

In particular, if is prime, then we know that is a divisor of for any . Thus we have that . The latter case only occurs when is a multiple of .

**Proposition:** Given two positive integers and , exists and is unique.

As we mentioned above, factorization is a very difficult process, so while the above proof shows how to construct the greatest common divisor, it is not very efficient. In the next section, we will discuss an algorithm which works much better.

The Division Algorithm

``''.

Reversing this procedure shows that . Moreover, the long division makes sure that , so that and we find are unique. Amazingly, this is all we need to do to find .

**Algorithm**[The Division Algorithm]: Let be
positive integers.

- Find and with such that .
- Find and with such that .
- Find and with such that .
- Repeat Step 3, dividing by until you have a remainder of zero (i.e. until you get to the first such that ).

Let's find . We follow the algorithm exactly:

Since , we see that . Indeed, one can also check that and .

Modular Arithmetic

Fix our modulus to be 38. Then if we want to compute 19+25 'wrapping around' 38, we simply find 19+25=44. Since 44>38, we need to subtract: 44-38=6. Thus, 19+25=6 'wrapped around' 38. Other operations work as well:

- Subtraction: Compute 14-33 'wrapped around' 38. Well, 14-33=-19, but -19<0, so we add 38 to see that 14-33=19 wrapped around 38.
- Multiplication: Compute 'wrapped around' 38. Well, , but 88>38, so we subtract off 38 from 88 to get 50. But since 50 is still larger than 38, we subtract off 38 from 50 to get 12. Then we have that 'wrapped around' 38.
- Division: This is more complicated and we will do this later.

**Theorem:** Let be a positive integer, and
let , , and be any
integers.

- If , then .
- If and , then .
- If , then .
- If , then .
- If , then .
- If and is relatively prime to , then .

Fix

- Addition: Compute . Well, and which is divisible by 38. Thus, .
- Subtraction: Compute . Well, and which is divisible by 38. Thus, .
- Multiplication: Compute . Well, and is divisible by 38. Thus .

These are chosen to illustrate why one should reduce first, and then do the arithmetic.

- Find . Well, and , so . Alternatively, and or and . Thus, . But and , so . In this case, it was one extra step to reduce first, but it kept the numbers we worked with smaller.
- Find . First we will do it directly: and . Thus, . Of course, we could have reduced first: and so that . Since and we get again that . We needed an extra step reducing first here also, but doing so made it so all of the arithmetic was easily done in one's head. Without reducing first, at the minimum there was some serious paper and pencil calculation.
- Compute . In this case, it would be
much too difficult to try this directly, even with a calculator. So
our only hope is to reduce 281 modulo 23 first. Well, so that . Thus, we know that . Now, we have two options. We can either use a
calculator and compute , or we can continue to
reduce modulo 23. Let's follow the second, since the first is fairly
straight forward.
How do we reduce modulo 23? Notice that . Thus, if we write

we can see that

Exercises

- If any of part of this section was unclear, head to the references section and find an introductory book on number theory. Read it. Do the exercises.
- Pick two two-digit numbers. Find their greatest common divisor. Pick two three-digit numbers. Find their greatest common divisor. Pick one three-digit number and one five-digit number. Find their greatest common divisor. Repeat this as many times as it takes until you are comfortable finding greatest common divisors.
- Do the following modular arithmetic:

This work was made possible through a grant from the National Science Foundation.