Prime Numbers


Definition. An integer greater than 1 is prime if its only positive factors are 1 and itself. An integer greater than 1 which is not prime is composite.

The prime numbers are the "building blocks" of the integers. I'll make this more precise later when I discuss the Fundamental Theorem of Arithmetic.

Lemma. Every integer greater than 1 is divisible by at least one prime.

Proof. I'll prove the result by induction. To begin with, the result is true for $n
   = 2$ , since 2 is prime.

Take $n > 2$ , and assume the result is true for all integers greater than 1 but less than n. I want to show that the result holds for n. If n is prime, it's divisible by a prime --- namely itself! So suppose n is composite. Then n has a positive factor a other than 1 and n. Suppose $n = ab$ .

If $a > n$ , then since $b \ge 1$ , I get $n = ab > n\cdot 1 = n$ , which is a contradiction. Thus, $a \le
   n$ , and since $a \ne n$ , I have in fact $a < n$ . Since $a \ne
   1$ , I get $1 < a < n$ .

By the induction hypothesis, a has a prime factor p. But $p \mid a$ and $a \mid n$ implies $p
   \mid n$ , so n has a prime factor as well. This shows that the result is true for all $n > 1$ by induction.

Theorem. (Euclid) There are infinitely many prime numbers.

Proof. Suppose on the contrary that there are only finitely many primes $p_1$ , $p_2$ , ..., $p_n$ . Look at

$$p_1\cdot p_2\cdot \cdots \cdot p_n + 1.$$

This number is not divisible by any of the primes $p_1$ , $p_2$ , ..., $p_n$ , because it leaves a remainder of 1 when divided by any of them. But the previous lemma says that every number greater than 1 is divisible by a prime. This contradiction implies that there can't be finitely many primes --- that is, there are infinitely many.

If you are trying to factor a number n, you do not need to try dividing by all the numbers from 1 to n: It's enough to go up to $\sqrt{n}$ . This is the idea of the next lemma.

Lemma. Every composite number has a proper factor less than or equal to its square root.

Proof. Suppose n is composite. I can write $n = ab$ , where $1 < a, b < n$ . If both $a, b > \sqrt{n}$ , then

$$n = \sqrt{n}\cdot \sqrt{n} < a\cdot b = n.$$

This contradiction shows that at least one of a, b must be less than or equal to $\sqrt{n}$ .

In fact, you can adapt the preceding proof to show that a composite number must have a prime factor less than or equal to its square root.

For an arbitrary number that is several hundred digits in length, it may be impossible with current technology to determine whether the number is prime. In fact, many cryptographic systems depend on the difficulty of factoring large numbers.


Example. To see whether 127 is prime, I only need to see if it has a prime factor $\le \sqrt{127} \approx 11.27$ . You can do the arithmetic to verify that 127 isn't divisible by 2, 3, 5, 7, or 11. Hence, it must be prime.


Example. ( The Sieve of Eratosthenes) The sieve is a method for generating a list of primes by hand. Write down the integer beginning with 2. Go through the list, crossing out every integer divisible by 2. Then go through the list, crossing out every integer divisible by 3. Keep going. I've illustrated the first two passes below.

$$\hbox{\epsfysize=2.5in \epsffile{primes1.eps}}$$

By the square root criterion above, I've already found all the primes less than 10, namely 2, 3, 5, and 7. After crossing out all the numbers divisible by 5, I'll have all the primes up to 25. And so on. Of course, more sophisticated sieve methods are used in practice.


I showed above that there are infinitely many primes. How are they distributed? That is, are they evenly distributed, or do they get "sparser" as you look at bigger and bigger integers? The Prime Number Theorem gives an aymptotic estimate for $\pi(x)$ , the number of primes less than or equal to x. It says:

$$\lim_{x\to +\infty} \dfrac{\pi(x)}{\dfrac{x}{\ln x}} = 1.$$

The picture below was generated by Mathematica, the symbolic mathematics program. It shows the graphs of $\pi(x)$ and $\dfrac{x}{\ln x}$ .

$$\hbox{\epsfysize=2in \epsffile{primes2.eps}}$$

The graph of $\pi(x)$ is on top and the graph of $\dfrac{x}{\ln x}$ is on the bottom.

The Prime Number Theorem was first conjectured by Legendre and Gauss. The first rigorous proofs were given by Hadamard and de la Vallee Poussin around 1896. Elementary proofs were given by Atle Selberg and Paul Erd\"os in the 1930's.

On the other hand, there are "lots" of composite numbers around. For example,

$$1001! + 2, 1001! + 3, 1001! + 4, \ldots, 1001! + 1001$$

is a run of 1000 consecutive composite numbers. You can use the same method to generate runs of composite numbers of any length.


Example. Use the Prime Number Theorem to estimate the number of primes less than 1000000.

By the Prime Number Theorem,

$$\pi(1000000) \approx \dfrac{1000000}{\ln 1000000} \approx 72382.$$

The actual number of primes less than 1000000 is $\pi(1000000) = 78498$ .


On the other hand, many problems concerning the distribution of primes are unsolved. For example, there are primes that come in pairs (two units apart), such as 11 and 13, or 71 and 73. These are called twin primes.

Question: ( Twin Prime Conjecture) Are there infinitely many twin primes?

There are enormously large twin primes known. The largest known in 2001 were

$$318032361.2^{107001}\pm 1,$$

which were discovered by David Underbakke and Phil Carmody. They are numbers having 32220 digits! The Twin Prime Conjecture is still unresolved: A proof was announced in 2004, but a gap was found, and the question remains open.


Send comments about this page to: bikenaga@marauder.millersville.edu.

Last updated: June 10, 2008

Bruce Ikenaga's Home Page

Math Department Home Page

Millersville University Home Page

Copyright 2008 by Bruce Ikenaga