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.

4.2 PRIMES 107<br />

It’s the factor- Sometimes it’s more useful to state the Fundamental Theorem in another<br />

ization, not the<br />

theorem, that’s<br />

way: Every positive integer can be written uniquely in the <strong>for</strong>m<br />

unique.<br />

n = nP”Y where each np 3 0. (4.11)<br />

P<br />

The right-hand side is a product over infinitely many primes; but <strong>for</strong> any<br />

particular n all but a few exponents are zero, so the corresponding factors<br />

are 1. There<strong>for</strong>e it’s really a finite product, just as many “infinite” sums are<br />

really finite because their terms are mostly zero.<br />

Formula (4.11) represents n uniquely, so we can think of the sequence<br />

(nz, n3, n5, . ) as a number system <strong>for</strong> positive integers. For example, the<br />

prime-exponent representation of 12 is (2,1,0,0,. . . ) and the prime-exponent<br />

representation of 18 is (1,2,0,0, . ). To multiply two numbers, we simply<br />

add their representations. In other words,<br />

k = mn k, = m,+n, <strong>for</strong>allp. (4.12)<br />

This implies that<br />

m\n<br />

and it follows immediately that<br />

mp < np <strong>for</strong> all p, (4.13)<br />

k = gcd(m,n) # k, = min(m,,n,) <strong>for</strong> allp; (4.14)<br />

k = lcm(m,n) W k, = max(m,,n,) <strong>for</strong> all p. (4.15)<br />

For example, since 12 = 22 .3’ and 18 = 2’ . 32, we can get their gcd and lcm<br />

by taking the min and max of common exponents:<br />

gcd(12,18) = 2min(2,li .3min(l,21 = 21 .31 = 6;<br />

lcm(12,18) = 2maX(2,1) . 3max(l,2) = 22 .32 = 36.<br />

If the prime p divides a product mn then it divides either m or n, perhaps<br />

both, because of the unique factorization theorem. But composite numbers<br />

do not have this property. For example, the nonprime 4 divides 60 = 6.10,<br />

but it divides neither 6 nor 10. The reason is simple: In the factorization<br />

60 = 6.10 = (2.3)(2.5), the two prime factors of 4 = 2.2 have been split<br />

into two parts, hence 4 divides neither part. But a prime is unsplittable, so<br />

it must divide one of the original factors.<br />

4.3 PRIME EXAMPLES<br />

How many primes are there? A lot. In fact, infinitely many. Euclid<br />

proved this long ago in his Theorem 9: 20, as follows. Suppose there were

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

Saved successfully!

Ooh no, something went wrong!