10.12.2012 Views

Prime Numbers

Prime Numbers

Prime Numbers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 3<br />

RECOGNIZING PRIMES AND COMPOSITES<br />

Given a large number, how might one quickly tell whether it is prime or<br />

composite? In this chapter we begin to answer this fundamental question.<br />

3.1 Trial division<br />

3.1.1 Divisibility tests<br />

A divisibility test is a simple procedure to be applied to the decimal digits<br />

of a number n so as to determine whether n is divisible by a particular<br />

small number. For example, if the last digit of n is even, so is n. (In fact,<br />

nonmathematicians sometimes take this criterion as the definition of being<br />

even, rather than being divisible by two.) Similarly, if the last digit is 0 or 5,<br />

then n is a multiple of 5.<br />

The simple nature of the divisibility tests for 2 and 5 are, of course, due<br />

to 2 and 5 being factors of the base 10 of our numeration system. Digital<br />

divisibility tests for other divisors get more complicated. Probably the next<br />

most well-known test is divisibility by 3 or 9: The sum of the digits of n is<br />

congruent to n (mod 9), so by adding up digits themselves and dividing by 3<br />

or 9 respectively reveals divisibility by 3 or 9 for the original n. This follows<br />

from the fact that 10 is one more than 9; if we happened to write numbers<br />

in base 12, for example, then a number would be congruent (mod 11) to the<br />

sum of its base-12 “digits.”<br />

In general, divisibility tests based on digits get more and more complicated<br />

as the multiplicative order of the base modulo the test divisor grows. For<br />

example, the order of 10 (mod 11) is 2, so there is a simple divisibility test<br />

for 11: The alternating sum of the digits of n is congruent to n (mod 11). For<br />

7, the order of 10 is 6, and there is no such neat and tidy divisibility test,<br />

though there are messy ones.<br />

From a computational point of view, there is little difference between a<br />

special divisibility test for the prime p and dividing by p to get the quotient<br />

and the remainder. And with dividing there are no special formulae or rules<br />

peculiar to the trial divisor p. Sowhenworkingonacomputer,orevenfor<br />

extensive hand calculations, trial division by various primes p is simpler and<br />

just as efficient as using various divisibility tests.

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

Saved successfully!

Ooh no, something went wrong!