§ 94. Some Information on Prime Numbers
It is easy to verify that there exists an infinite number of prime numbers. Indeed, let us assume the contrary, i.e., that there is a finite number of prime numbers. In that case, there must exist a greatest prime number.
Let this number be a. To refute this assumption, let us imagine a new number N, constructed according to the formula:
N = (2 · 3 · 5 · 7... a) + 1, i.e., let us imagine a number that is obtained by multiplying all prime numbers from 2 to a inclusive and adding one to the product. Since N is obviously greater than a, and a, according to the assumption, is the greatest of the prime numbers, N must be a composite number. But a composite number is divisible by some prime number (§ 93, Theorem 1). Consequently, N is divisible by some number from the series: 2, 3, 5, 7, 11,..., a. But this cannot be, since N is the sum of two terms, of which the first (the product 2 · 3 · 5... a) is divisible by every number from the series: 2, 3, 5, 7, ..., a, and the second (1) is not divisible by any of these numbers. Thus, there is no greatest prime number; and if there is no greatest prime number, then the series of prime numbers is infinite.
Since ancient times, prime numbers have been the subject of numerous studies. Among other things, scientists have tried to find a law for constructing prime numbers that would make it possible to express all prime numbers by one or several formulas, or they have tried to find at least such a formula that, although it does not express all prime numbers, would allow finding an arbitrarily large prime number. In this sense, the attempt by the famous French mathematician of the 17th century, Fermat, is particularly interesting. He found that the formula 2n + 1 gives prime numbers when n is equal to 20 = 1, 21 = 2, 22 = 4, 23 = 8. Indeed, for these values of the exponent n, the following prime numbers are obtained:
3, 5, 17, 257.
Based on this observation (and on certain considerations regarding the properties of numbers), Fermat expressed the hypothesis that the formula 2n + 1 must give prime numbers for any n equal to a power of 2. This opinion was not refuted for a long time, because no one (until Euler) succeeded in pointing out even one case where, for n equal to a power of 2, the formula 2n + 1 would yield a composite number*. The first to refute Fermat's hypothesis was the famous Euler (18th century), who proved that for n = 25 = 32, the formula 2n + 1 gives a number divisible by 641. This error by Fermat serves as an instructive example of how inapplicable the method of reasoning from the particular to the general (the method of induction) is in mathematics.
In the absence of formulas expressing all prime numbers, there is a need to empirically (by experimental means) construct a series of consecutive prime numbers from 2 to some definite large number a. The simplest and at the same time the most ancient method of constructing such a series belongs to the Alexandrian mathematician Eratosthenes (who lived in the 3rd century BC). Eratosthenes' method consists in excluding from the series of natural numbers from 2 to a (the number by which one wishes to limit the series) first all numbers divisible by 2 (except 2), then all numbers divisible by 3 (except 3), then all numbers divisible by 5, by 7, by 11 (except these numbers themselves), and so on. This is done very simply: having written out the series of odd numbers from 3 to a, one crosses out every third number after 3, every fifth number after 5, every seventh number after 7, and so on.
At present, there are tables of all consecutive prime numbers less than 9,000,000.
If a written-out series of prime numbers is not at hand, or if the given number N exceeds the greatest number in the written-out series, the question arises: how to determine whether N is a prime or a composite number? The simplest way to do this consists of the following. Having previously found √N, one writes out all prime numbers less than this root. Let these be the numbers:
2, 3, 5, 7..., a.
If N is not divisible by any of these numbers, one can assert, without performing further divisions, that N is a prime number. Indeed, since N = √N · √N, it is obvious that dividing N by numbers greater than √N must yield quotients less than √N; therefore, if the number N could be divided by some number greater than √N, it would also be divisible by a number less than √N. When N is large, this method can be very tedious; for example, if N > 1,000,000, then √N > 1000, and there are 168 prime numbers less than 1000; consequently, testing such a number would sometimes require up to 168 divisions. In number theory, methods are indicated by which the number of divisions required for testing a given number can be significantly reduced; but even so, the question of determining whether a given number is prime or composite still presents enormous difficulties at times.