<<

1 Number Theory and Graph Theory

Chapter 2

Prime numbers and congruences.

By

A. Satyanarayana Reddy

Department of Shiv Nadar University Uttar Pradesh, India

E-mail: [email protected] 2

Module-3: Is there any formula for prime numbers?

Objectives

1. Large gap between the primes.

2. theorem.

3. Fermat primes, Mersenne primes.

• Prime numbers have baffled scientists for millennia. Primes do not occur in any easily discernible order which makes it very difficult to figure out whether a really huge number is prime or not (and by really huge, we are talking of thousands of digits long).

• Ever since the time of the ancient Greeks, finding a simple way to prove a number is prime has been the holy grail of mathematics, and the hunt has nearly driven several scientists mad.

• In 2002, 6th August, M. Agrawal of the Indian Institute of Technology, Kanpur, India, and two of his undergraduate students, N. Kayal and N. Saxena, distributed a nine-page paper that rocked the scientific world. They had hit upon an ingenious algorithm that runs in polynomial time to prove whether a number is prime, no matter how enormous. That is, the number of steps (needed to verify whether a number is prime or not) is bounded by a polynomial function in the length of the input data.

@ As the number sequence starts, primes are commonplace as there is little scope for small numbers to have . But, as we go farther down the number sequence the primes seem to become rare. But, we do keep getting them.

@ The thinning process of prime occurrence is, however, quite leisurely and surprisingly erratic. 3

@ 3,5,7 is the only trio containing three consecutive odd numbers that are primes as every third odd number is divisible by 3.

If a ∈ Z, then verify that one of a,a + 2 and a + 4 is divisible by 3.

@ The gap between consecutive primes after first two is at least two. So the nth prime pn ≥ 2n − 1.

@ The gap between two consecutive primes can be made as large as possible (prime desert problem).

Let n ∈ N and define M = (n + 1)!. Then, it is easy to see that M + 2,M + 3,...,M + n,M + (n + 1) are composite numbers.

@ Number theorists often dream of finding formulas that generate primes for consecutive values of the integral variable n. Euler found one such formula in 1772: E(n) = n2 − n + 41 yields a prime for every integer n = 0,1,...,40. But when n = 41, E(41) = 412 − 41 + 41 = 412 is not a prime.

@ However, no one has ever been successful in constructing a polynomial f (n) that generates primes for all integers n.

Theorem 1. There is no non-constant polynomial f (n) with integral coefficients that takes on just prime values for integral n.

k k−1 Proof. Let f (n) = akn + ak−1n + ··· + a1n + a0, where all coefficients a0,a1,...,an are

integers, and ak 6= 0. Also assume that f (n) takes only prime values. k For a fixed m ∈ Z, suppose p = f (m) is a prime number. Then, f (m +t p) = ak(m + pt) + k−1 ak−1(m + pt) + ··· + a1(m + pt) + a0 = f (m) + pq(t), where t ∈ Z. Clearly, p| f (m +t p) as p = f (m). Therefore, using our assumption that f takes only prime values, we get f (m +t p) = p for all t. 4

Hence, the polynomial g(t) = f (m+ pt)− p has infinite number of roots in Z, a contradiction, as a polynomial of degree k can have at most k roots in Z.

After the failure of finding a simple formula for prime numbers, the struggle started to find a formula which provides number of primes less than or equal to a given real number x.

Definition 2. Let x ∈ R, x > 0. Then, by π(x), we denote the number of primes p that are less than or equal to x.

For example, since the only primes p ≤ 10 are 2, 3, 5, and 7 we have π(10) = 4. Here is a table of values of π(10i) for i = 2,...,10. It also contains known approximations (rounded each to the nearest integer) to π(x).

x x R x 1 x π(x) dt ln(x) ln(x)−1 2 ln(t)

102 25 22 28 29

103 168 145 169 177

104 1229 1086 1218 1245

105 9592 8686 9512 9629

106 78498 72382 78030 78627

107 664579 620421 661459 664917

108 5761455 5428681 5740304 5762208

9 10 50847534 48254942 50701542 50849234

10 10 455052511 434294482 454011971 455055614 The above approximations are based on the so-called Prime Number Theorem first conjectured by Gauss in 1793 but not proved till over 100 years later (1896) by Hadamard and Vallee´ Poussin.

Theorem 3 (The Prime Number Theorem). x π(x) ∼ for all x > 0. (∗) ln(x) 1 MERSENNE AND FERMAT NUMBERS 5

Remark 4. (∗) means that π(x) lim = 1. x→∞ x ln(x) Therefore, we note that even though there are long stretches of consecutive integers containing no x primes but the proportion of primes till any particular number x behaves as the function . ln(x)

• In a way, the above formula states that about 1 in ln x of numbers up to x are prime, when x is large.

• So, for example, around x = 106, we expect about 1 in 14 numbers to be prime and around x = 1050, we expect about 1 in 115 numbers to prime. The primes thin out according to a logarithm law, but of course this is only an average thinning out.

• In the year 1850, Chebyshev proved that for a sufficiently large x, there exists A,B ∈ R such that π(x)logx A < < B. x π(x) He also showed if the limit of limx→∞ x exists, then it should be 1. ln(x)

1 Mersenne and Fermat numbers

One way to find large primes is to look at numbers that have some special form, for example, numbers of the form an + 1 or an − 1. It is easy to rule out some values of a and n. For example we have:

Theorem 5. Let a > 1 and n > 1. Then

(1) an − 1 is prime ⇒ a = 2 and n is prime

(2) an + 1 is prime ⇒ a is even and n = 2k for some k ≥ 1. 1 MERSENNE AND FERMAT NUMBERS 6

Proof of (1). We know that

an − 1 = (a − 1)(an−1 + ··· + a + 1). (1)

• Note that if a > 2 and n > 1 then a − 1 > 1 and an−1 + ··· + a + 1 ≥ a + 1 > 3. So, both factors in Equation (1) are > 1 and thus, an − 1 is not a prime. Hence, if an − 1 is prime, we must have a = 2.

• Now suppose 2n − 1 is prime. We claim that n is prime.

• Let n = st, where 1 ≤ s ≤ n, 1 ≤ t ≤ n. Then,

2n − 1 = 2st − 1 = (2s)t − 1

is prime. But, if we replace a by 2s in Equation (1), we see that 2n − 1 is prime only if s = 1 and thus, t = n. Hence, n must be prime. This proves (1).

Proof of (2). a is even: If a > 1 is odd, then an + 1 > 2 is even and hence an + 1 is not a prime. Thus, a must me even.

k n is 2 for some k ∈ N: We first show that n is even. Let if possible n > 1 be odd, say n = 2m + 1. Then, an + 1 = a2m+1 + 1 = (a + 1)(a2m − a2m−1 + ··· + a2 − a + 1).

Consequently, whenever n > 1 is odd, the number a + 1 > 1 is a factor of an + 1 and hence an + 1 is not a prime.

Now, suppose that n = 2st, where t > 1 is odd. Then, a similar argument applied to an + 1 = s (a2 )t + 1 gives a contradiction to an + 1 being a prime. So, we must have t = 1 and n = 2s. 1 MERSENNE AND FERMAT NUMBERS 7

n Definition 6. A number of the form Mn = 2 − 1, n ≥ 2, is said to be a Mersenne number. If Mn (2n) is prime, it is called a . A number of the form Fn = 2 + 1, n ≥ 0, is called a

Fermat number. If Fn is prime, it is called a Fermat prime.

• One may prove that F0 = 3, F1 = 5, F2 = 17, F3 = 257 and F4 = 65537 are primes.

(2n) • As n increases the numbers Fn = 2 + 1 increase in size very rapidly, and are not easy to check for primality. The next 243 Fermat numbers are known to be composite. So, now there is a that only the first four Fermat numbers are prime.

• So, Fermat’s original thought that Fn will be a prime for infinitely many seems to be pretty far from reality.

2k Lemma 7. Let Fk = 2 + 1. Then F0 · F1 ···Fn−1 = Fn − 2.

Proof. We prove the result by induction on n. Base case n = 2, we have F0 · F1 = 3 · 5 = 15 =

17 − 2 = F2 − 2.

Suppose the result is true for n = m. That is F0 · F1 ···Fm−1 = Fm − 2. 2m 2m 2m+1 consider F0 · F1 ···Fm−1 · Fm = (F0 · F1 ···Fm−1)Fm = (Fm − 2)Fm = (2 − 1)(2 + 1) = (2 +

1 − 2) = Fm+1 − 2.

Theorem 8. For distinct positive integers m,n the Fermat numbers Fn,Fm are relatively prime.

Proof. Let gcd(Fn,Fm) = d. Also suppose that n < m. Then d|Fn,d|F0 · F1 ···Fn · Fn+1 ···Fm−1 =

Fm − 2. Consequently d|2. Hence d = 1 follows from fact that Fermat numbers are odd.

Note we already proved in Theorem 5 that if Mn is prime, then n is prime. The first few Mersenne primes are 3,7,31,127,8191,131071 and 524287 which correspond to the primes 2,3,5,7,13,17 11 and 19, respectively. Note that M11 = 2 − 1 = 2047 = 23 · 89 is not a prime. Over the years, people have continued to work on the problem of determining for which primes p p p, Mp = 2 − 1 is prime. To date, 48 Mersenne primes have been found. It is known that 2 − 1 is 1 MERSENNE AND FERMAT NUMBERS 8 prime if p is one of the following 48 primes 2 3 5 7 13 17 19 31 61 89 107 127 521 607 1279 2203 2281 3217 4253 4423 9689 9941 11213 19937 21701 23209 44497 86243 110503 132049 216091 756839 859433 1257787 1398269 2976221 3021377 6972593 13466917 20996011 24036583 25964951 30402457 32582657 37156667 42643801 43112609 57,885,161

13466917 The Mersenne prime M13466917 = 2 − 1 was found on November 14, 2001. The decimal representation of this number has 4,053,946 digits. It was found by the team of Michael Cameron, George Woltman, Scott Kurowski et al, as a part of the Great Internet Mersenne Prime Search (GIMPS), see Chris Caldwell’s page (http://primes.utm.edu/largest.html) for more on this topic. This prime could be the 49th Mersenne prime (in order of size), but we will only know this for sure when GIMPS completes testing all exponents below this one. The current largest known prime is 257,885,161 − 1 that has 17,425,170 digits and was found in Jan 25,2013 (by researchers from the University of Central Missouri). The most basic question about Mersenne primes is: Are there infinitely many Mersenne primes?