Number Theory Learning Module 2 — Prime Numbers and the

advertisement
Number Theory
Learning Module 2 — Prime Numbers and the Fundamental Theorem of Arithmetic
1
1
Objectives.
• Understand the definition of prime number.
• Understand prime factorization of integers.
• Learn the Fundamental Theorem of Arithmetic (FTA).
• Learn the basic methods for primality testing and integer factorization.
2
Prime Numbers
The notion of prime number is fundamental to all of number theory. Prime numbers are “irreducible”, in the sense
that they cannot be expressed as a product of smaller factors. Many of the problems studied in number theory relate to
properties of primes. Here are the basic definitions:
Definition 2.1. Let a ¡ 1 be an integer. We say that a is a prime number (or, for brevity, a prime) if its only positive
divisors are 1 and a. If a is not prime, it is said to be composite. The number 1 is neither prime nor composite.
For example, the numbers 2, 3, 5, 11, 101 and 243,112,609 1 are prime. The last number is the largest known prime
as of this writing, discovered in August of 2008, and has 12,978,189 digits. The number was found by a collaborative
project called “Great Internet Mersenne Prime Search” (GIMPS), which uses personal computers around the world to
search for primes. See the GIMPS page, http://www.mersenne.org/prime.htm, for details.
Examples of composite numbers are, 4 2 2, 714 21 34, and
2128
1 59649589127497217 5704689200685129054721
(2.1)
The last number was factored by Morrison and Brillhart in 1970, using one of the first algorithms for factoring especially designed for modern electronic computers.
Notice that our definition explicitly excludes negative numbers. This convention is not universal, but facilitates the
statement of some results. The convention that 1 is not prime is, however, essential. This convention comes from the
fact that 1 had a multiplicative inverse in the set of integer numbers, since 1 1 1. We say that 1 is an unit of the set
of integers. According to this definition, the number 1 is also said to be an unit, and t1, 1u are all the units in the
set of integers.
Primes are important because any integer a ¡ 1 can be written as a product of prime numbers. This product is called
the prime factorization of a. Examples of prime factorizations are 12 22 3, 138269 372 101, and formula (2.1).
We will now proceed to show the existence of a prime factorization for any integer greater than 1. The first step is
19
to show that all such integers have a prime divisor. For example, it is known that the number 22
1 has the prime
divisor 8962167624028624126082526703 (see http://www.fermatsearch.org/news.html). This was, of course,
obtained with the use of computers: just verifying that the number above is prime unfeasible by hand computations.
An even if you use a fast computer, the verification must use computational methods discovered and improved in the
last 30 years!
This example, incidentally, shows why proofs are important: we can be always sure that any number greater than
one has a prime divisor, no matter how large the number is. (Finding a divisor, however, may require the use of a
computer and clever algorithms.) Here is the result:
Theorem 2.2. Every integer greater than 1 has a prime divisor.
Created by L. Felipe Martins.
l.martins@csuohio.edu
License: http://creativecommons.org/licenses/by-nc-sa/3.0/us/
Number Theory
Learning Module 2 — Prime Numbers and the Fundamental Theorem of Arithmetic
2
Proof. Suppose that there exists a number a1 ¡ 1 that has no prime divisor. Then, a1 is not prime (otherwise a1 itself
would be a prime factor of a1 ), so a1 is composite. Then, a1 has a divisor a2 with 1 a2 a1 . The integer a2 cannot
be prime (remember, we are assuming that a1 has no prime divisors). Thus, a2 has a divisor a3 such that 1 a3 a2 .
By repeating this procedure, we obtain an infinite sequence of positive integers such that:
a1 ¡ a2 ¡ a3 ¡ a4 ¡ . . . ¡ an ¡ . . . ¡ 1.
But this is not possible, since there are only finitely many integers between 1 and a1 . This contradiction shows that,
contrary to the initial hypothesis, a1 must have a prime factor.
The reasoning used above is called “proof by infinite descent”, and was used by the french mathematician Pierre
de Fermat to prove many interesting results in number theory. The method can be summarized as follows:
1. We wish to prove a proposition about integer numbers.
2. Assume that the proposition is false.
3. From this assumption, construct an infinite, strictly decreasing, sequence of positive integers.
4. Since this is an impossibility, we conclude that our initial assumption is incorrect. Thus, the proposition must be
true.
We can now prove the following:
Theorem 2.3. There are infinitely many prime numbers.
Proof. Suppose that there are only finitely many primes, and call these p1 , p2 , . . . pn . We will show how to construct a
prime number not equal to any of the pi ’s. Consider the number
a p1 p2 pn
1.
(2.2)
Then, by Theorem 2.2, a has a prime divisor p. If p pi for some i, 1 ¤ i ¤ n, then p divides p1 , p2 , . . . pn , so p would
also be a divisor of 1, which is a contradiction.
This proof was given by the greek mathematician Euclid of Alexandria, who lived around 300 BCE.
3
The Fundamental Theorem of Arithmetic
Prime numbers are sometimes called the “building blocks” of all integers, meaning that all integers (larger than one)
can be expressed as products of primes.
Let’s suppose that a ¡ 1 is an integer. By Theorem 2.2, a has a prime divisor, which we call p1 . Thus,
a p1 q1 , with 1 ¤ q1 a.
Now, if q1 1, then a p1 is prime, and we stop here. Otherwise, using Theorem 2.2, q1 has a prime divisor, which
we call p2 . Then, we can write:
a p1 p2 q2 , with 1 ¤ q2 q1 .
Again, if q2 1 we stop. Otherwise, q2 has a prime divisor p3 , and we write:
a p1 p2 p3 q3 , with 1 ¤ q3 q1 .
Created by L. Felipe Martins.
l.martins@csuohio.edu
License: http://creativecommons.org/licenses/by-nc-sa/3.0/us/
Number Theory
Learning Module 2 — Prime Numbers and the Fundamental Theorem of Arithmetic
3
Proceeding this way, we obtain a sequence of positive integers q1 ¡ q2 ¡ q3 ¡ . . .. This sequence cannot be infinite, so
there must be a n such that qn 1 1. At this point we will have written a as a product of primes:
a p1 p2 p3 . . . pn .
We have thus proved the following:
Theorem 3.1 (Fundamental Theorem of Arithmetic, existence part). Every integer greater than 1 can be written as a
product of primes.
Notice in the proof above that we may stop in the first step, when a itself is prime. In this case, we make the
convention that a is a “product of only one prime”.
A more remarkable fact is that, if two people write the same integer as a product of primes, they will arrive,
essentially, to the same result. For example, let’s say that the integer 495. Someone (let’s call her Lucy) might
immediately see that this number is a multiple of 5, and write 495 5 99. She then notices that 99 11 9 and writes
her factorization as
495 5 11 3 3.
(3.1)
Another student (Joe) systematically attempts division by the primes 2, 3, 5,. . . He comes up with the factorization:
495 3 3 5 11
(3.2)
We will make the assumption that equations (3.1) and (3.2) represent the same factorization. Formally, we say that the
factorizations (3.1) and (3.2) are the same except for the order of the factors. With this convention, we have:
Theorem 3.2 (Fundamental Theorem of Arithmetic, uniqueness part). The prime factorization of an integer greater
than 1 is unique, except for the order of the factors.
We finish this section with some conventions about how prime factorizations are written. We will generally write
repeated factors as power, for example 495 32 5 11. A general prime factorization will be written as:
pe11 pe22 . . . penn
In general, in this representation we assume that:
1. The primes p1 , p2 , . . . , pn are distinct.
2. The exponents e1 , e2 , . . . , en are positive.
We also write this using product notation:
n
¹
pei i .
i 1
Sometimes, when writing some proofs, it will be convenient to allow some of the exponents e1 , e2 , . . . , en be zero. In
this case one should be aware that the representation is not unique. For example, we can write 23 13 as 23 50 13
or as 23 50 13 1010 , etc.
We postpone the proof of the uniqueness part of the FTA to a more convenient place in the development.
Created by L. Felipe Martins.
l.martins@csuohio.edu
License: http://creativecommons.org/licenses/by-nc-sa/3.0/us/
Number Theory
Learning Module 2 — Prime Numbers and the Fundamental Theorem of Arithmetic
4
4
Primality Testing and Factorization
It turns out that testing a number for primality and finding the factorization of an integers are two of the most important
computational tasks in number theory. In this section we present the most straightforward ways to do this.
The first idea to check if a number is prime or composite is to attempt division for all primes smaller than the
number. For example, to check if a 101 is prime, we attempt division by:
r2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97s
There is a small improvement, however. Suppose that?a is a composite integer, and we write a bc, with both b
and c smaller than a. If b and c were both larger than the
a, then we would have:
??
a bc ¡ a a a.
This contradiction shows that a composite number a always has a proper divisor less than or equal
? to
mean that, to check primality of a, we need only attempt division by primes less than or equal to t au.
?
X
a
paq.
This
\
Example 4.1. Determine if 101 is prime. We only have to divide by the primes up to 101 t10.0498756211209u 10. That is, we need only consider the primes 2, 3, 5, 7. One immediately sees that 101 is not a multiple of 2, 3 and 5.
Since 98 70 28 is a multiple of 7, 101 cannot be a multiple of 7. Thus, we conclude that 101 is prime.
Example 4.2. Find the factorization of 42680. We start with trying the primes 2, 3, 5, 7, 11, which gives us:
42680 23 5 11 97
Now notice that the last prime number we compute satisfies the inequality:
112 121 ¡ 97.
Thus, if 97 had a proper prime factor, it would have to be smaller than 11. Since we already tried all these primes, we
can deduce that 97 is prime (without any extra work!), and conclude that the factorization of 42680 is 23 5 11 97
5
Problems
1. This problem shows how the method of infinite descent can be used to show that
(a) To obtain a contradiction, we start?by assuming that
positive integers a and b such that 2 a{b.
?
?
2 is irrational.
2 is rational. That is, we assume that there are
(b) Show that a must be even, so that we can write a 2a1 for some integer a1 .
(c) Then show that b must be even, so that we can write b 2b1 for some integer b1 .
(d) Write
?
2 in terms of a1 and b1 .
?
(e) How can the idea above be used to construct an infinite sequence of strictly decreasing integers?
(f) Put together the observations above, and carefully write a complete proof of the irrationality of
2.
2. Determine if the following numbers are prime. Before doing each item, determine the range of primes that must
be tested.
(a) 527
Created by L. Felipe Martins.
l.martins@csuohio.edu
License: http://creativecommons.org/licenses/by-nc-sa/3.0/us/
Number Theory
Learning Module 2 — Prime Numbers and the Fundamental Theorem of Arithmetic
5
(b) 139
(c) 887
(d) 961
3. Find the prime factorizations of the following integers. Explain how you did it, and use the technique explained
in Section 4 to make the calculation as short as possible.
(a) 18928
(b) 108261
(c) 286843
4. Using only a list of prime numbers up to 1000 and trial division, what is the large integer that can be determined
to be prime or composite?
5. The CPU of most personal computers made today use registers. The largest integer number that can be represented in 64 bits is 18446744073709551615. Suppose that we want to use a table of primes to decide primality
of any integer representable in a 64-bit CPU, using trial division and a table of primes. How many primes will
there be in this table? Hint: the Sage function prime_pi(n) returns the number of primes in the interval r1, ns.
?
6. Show that every positive composite integer a has a divisor larger than or equal to r as.
7. Solve the following problems:
(a) Let a and n be a positive integers, with a ¥ 2. Show that, if n is composite, then an 1 is composite.
(b) Give an example of numbers a ¥ 2 and n prime such that an 1 is composite.
8. Define the number:
an p1 p2 pn
1,
where p1 2, p2 3, p3 5, p4 7, p5 11, . . . is the sequence of prime integers. For example, a1 2
a2 2 3 1, a3 2 3 5 1. Answer the following, using a computer if you find it necessary:
1,
(a) Find the smallest value of n such that an is composite.
(b) Find a value m ¡ n such that am is prime.
9. Let the positive number a have the prime factorization pe11 pe22 . . . penn . Write a formula for the total number of
divisors of a in terms of the exponents e1 , e2 , . . . , en .
10. In this problem and the next we describe a method invented by Fermat to attempt to find a divisor of numbers
that don’t have obvious small factors. Let a ¡ 1 be a positive integer. Suppose that we can find integers x and y
such that a x2 y2 . Show how to obtain factors of a from this.
11. Fermat proposed the following systematic way to find x and y as in the previous problem:
?
(a) Let x r as.
(b) Let w x2 a.
(c) If y ?w is an integer, we stop, and use x and y to find a factor of a.
(d) Otherwise, increase x by 1 and go to step (b)
Created by L. Felipe Martins.
l.martins@csuohio.edu
License: http://creativecommons.org/licenses/by-nc-sa/3.0/us/
Number Theory
Learning Module 2 — Prime Numbers and the Fundamental Theorem of Arithmetic
6
Explain how is a factor of a found from x, y in step (c), and then use Fermat’s method to find factors of 64512583
and 24075239
12. Show that, for all composite integer a, it is possible to find integers x and y such that a x2 y2 . (This shows
that Fermat’s factorization method, described in the previous problem, will always find a factor of a composite
integers.)
13. This problem investigates when the number logpaq{ logpbq is rational, for positive integers a and b. (You can
assume that log represents the logarithm in base 10, but it really does not matter, since the quotient of logarithms
is independent of the basis.) Hint: The FTA will be important in this problem.
(a) Is logp36q{ logp7776q a rational number?
(b) Is logp2q{ logp3q a rational number?
(c) Show that, if there is a prime number p that does not divide both a and b, then logpaq{ logpbq is irrational.
What does this imply about the prime factorizations of a and b?
(d) Show that log a{ log b is rational if and only if there is an integer c such that both a and b are powers of c.
Created by L. Felipe Martins.
l.martins@csuohio.edu
License: http://creativecommons.org/licenses/by-nc-sa/3.0/us/
Download