09.12.2012 Views

Concrete mathematics : a foundation for computer science

Concrete mathematics : a foundation for computer science

Concrete mathematics : a foundation for computer science

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

110 NUMBER THEORY<br />

But 2P - 1 isn’t always prime when p is prime; 2” - 1 = 2047 = 23.89 is the<br />

smallest such nonprime. (Mersenne knew this.)<br />

Factoring and primality testing of large numbers are hot topics nowadays.<br />

A summary of what was known up to 1981 appears in Section 4.5.4 of [174],<br />

and many new results continue to be discovered. Pages 391-394 of that book<br />

explain a special way to test Mersenne numbers <strong>for</strong> primality.<br />

For most of the last two hundred years, the largest known prime has<br />

been a Mersenne prime, although only 31 Mersenne primes are known. Many<br />

people are trying to find larger ones, but it’s getting tough. So those really<br />

interested in fame (if not <strong>for</strong>tune) and a spot in The Guinness Book of World<br />

Records might instead try numbers of the <strong>for</strong>m 2nk + 1, <strong>for</strong> small values of k<br />

like 3 or 5. These numbers can be tested <strong>for</strong> primality almost as quickly as<br />

Mersenne numbers can; exercise 4.5.4-27 of [174] gives the details.<br />

We haven’t fully answered our original question about how many primes<br />

there are. There are infinitely many, but some infinite sets are “denser” than<br />

others. For instance, among the positive integers there are infinitely many<br />

even numbers and infinitely many perfect squares, yet in several important<br />

senses there are more even numbers than perfect squares. One such sense<br />

looks at the size of the nth value. The nth even integer is 2n and the nth<br />

perfect square is n’; since 2n is much less than n2 <strong>for</strong> large n, the nth even<br />

integer occurs much sooner than the nth perfect square, so we can say there<br />

are many more even integers than perfect squares. A similar sense looks at<br />

the number of values not exceeding x. There are 1x/2] such even integers and<br />

L&j perfect squares; since x/2 is much larger than fi <strong>for</strong> large x, again we<br />

can say there are many more even integers.<br />

What can we say about the primes in these two senses? It turns out that<br />

the nth prime, P,, is about n times the natural log of n:<br />

pll N nlnn.<br />

(The symbol ‘N’ can be read “is asymptotic to”; it means that the limit of<br />

the ratio PJnlnn is 1 as n goes to infinity.) Similarly, <strong>for</strong> the number of<br />

primes n(x) not exceeding x we have what’s known as the prime number<br />

theorem:<br />

Proving these two facts is beyond the scope of this book, although we can<br />

show easily that each of them implies the other. In Chapter 9 we will discuss<br />

the rates at which functions approach infinity, and we’ll see that the function<br />

nlnn, our approximation to P,, lies between 2n and n2 asymptotically.<br />

Hence there are fewer primes than even integers, but there are more primes<br />

than perfect squares.<br />

Weird. I thought<br />

there were the same<br />

number of even<br />

integers as perfect<br />

squares, since<br />

there’s a one-to-one<br />

correspondence<br />

between them.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!