3.1 Basic Notions

3.1.1 Divisibility

Number theory is concerned with the properties of the integers. One of the most important is divisibility.

Definition

Let a and b be integers with a0. We say that a divides b,  if there is an integer k such that b=ak. This is denoted by a|b. Another way to express this is that b is a multiple of a.

Example

3|15,  15|60,  718 (does not divide).

The following properties of divisibility are useful.

Proposition

Let a, b, c represent integers.

  1. For every a0,  a|0 and a|a. Also, 1|b for every b.

  2. If a|b and b|c,  then a|c.

  3. If a|b and a|c,  then a|(sb+tc) for all integers s and t.

Proof. Since 0=a0,  we may take k=0 in the definition to obtain a|0. Since a=a1,  we take k=1 to prove a|a. Since b=1b,  we have 1|b. This proves (1). In (2), there exist k and such that b=ak and c=b. Therefore, c=(k)a,  so a|c. For (3), write b=ak1 and c=ak2. Then sb+tc=a(sk1+tk2),  so a|sb+tc.

For example, take a=2 in part (2). Then 2|b simply means that b is even. The statement in the proposition says that c,  which is a multiple of the even number b,  must also be even (that is, a multiple of a=2).

3.1.2 Prime Numbers

A number p>1 whose positive divisors are only 1 and itself is called a prime number. The first few primes are 2, 3, 5, 7, 11, 13, 17, . An integer n>1 that is not prime is called composite, which means that n must be expressible as a product ab of integers with 1<a, b<n. A fact, known already to Euclid, is that there are infinitely many prime numbers. A more precise statement is the following, proved in 1896.

Prime Number Theorem

Let π(x) be the number of primes less than x. Then

π(x)xlnx, 

in the sense that the ratio π(x)/(x/lnx)1 as x.

We won’t prove this here; its proof would lead us too far away from our cryptographic goals. In various applications, we’ll need large primes, say of around 300 digits. We can estimate the number of 300-digit primes as follows:

π(10300)π(10299)10300ln1030010299ln102991.4×10297.

So there are certainly enough such primes. Later, we’ll discuss how to find them.

Prime numbers are the building blocks of the integers. Every positive integer has a unique representation as a product of prime numbers raised to different powers. For example, 504 and 1125 have the following factorizations:

504=23327, 1125=3253.

Moreover, these factorizations are unique, except for reordering the factors. For example, if we factor 504 into primes, then we will always obtain three factors of 2, two factors of 3, and one factor of 7. Anyone who obtains the prime 41 as a factor has made a mistake.

Theorem

Every positive integer is a product of primes. This factorization into primes is unique, up to reordering the factors.

Proof. There is a small technicality that must be dealt with before we begin. When dealing with products, it is convenient to make the convention that an empty product equals 1. This is similar to the convention that x0=1. Therefore, the positive integer 1 is a product of primes, namely the empty product. Also, each prime is regarded as a one-factor product of primes.

Suppose there exist positive integers that are not products of primes. Let n be the smallest such integer. Then n cannot be 1 (= the empty product), or a prime (= a one-factor product), so n must be composite. Therefore, n=ab with 1<a, b<n. Since n is the smallest positive integer that is not a product of primes, both a and b are products of primes. But a product of primes times a product of primes is a product of primes, so n=ab is a product of primes. This contradiction shows that the set of integers that are not products of primes must be the empty set. Therefore, every positive integer is a product of primes.

The uniqueness of the factorization is more difficult to prove. We need the following very important property of primes.

Lemma

If p is a prime and p divides a product of integers ab,  then either p|a or p|b. More generally, if a prime p divides a product abz,  then p must divide one of the factors a, b, , z.

For example, when p=2,  this says that if a product of two integers is even then one of the two integers must be even. The proof of the lemma will be given at the end of the next section, after we discuss the Extended Euclidean algorithm.

Continuing with the proof of the theorem, suppose that an integer n can be written as a product of primes in two different ways:

n=p1a1p2a2psas=q1b1q2b2qtbt, 

where p1, , ps and q1, , qt are primes, and the exponents ai and bj are nonzero. If a prime occurs in both factorizations, divide both sides by it to obtain a shorter relation. Continuing in this way, we may assume that none of the primes p1, , ps occur among the qj’s. Take a prime that occurs on the left side, say p1. Since p1 divides n,  which equals q1q1q1q2q2cdotsqtqt,  the lemma says that p1 must divide one of the factors qj. Since qj is prime, p1=qj. This contradicts the assumption that p1 does not occur among the qj’s. Therefore, an integer cannot have two distinct factorizations, as claimed.

3.1.3 Greatest Common Divisor

The greatest common divisor of a and b is the largest positive integer dividing both a and b and is denoted by either gcd(a, b) or by (a, b). In this book, we use the first notation. To avoid technicalities, we always assume implicitly that at least one of a and b is nonzero.

Example

gcd(6, 4)=2, gcd(5, 7)=1, gcd(24, 60)=12.

We say that a and b are relatively prime if gcd(a, b)=1. There are two standard ways for finding the gcd:

  1. If you can factor a and b into primes, do so. For each prime number, look at the powers that it appears in the factorizations of a and b. Take the smaller of the two. Put these prime powers together to get the gcd. This is easiest to understand by examples:

    576=2632, 135=335, gcd(576, 135)=32=9gcd(253472, 22537)=22305071=227=28.

    Note that if a prime does not appear in a factorization, then it cannot appear in the gcd.

  2. Suppose a and b are large numbers, so it might not be easy to factor them. The gcd can be calculated by a procedure known as the Euclidean algorithm. It goes back to what everyone learned in grade school: division with remainder. Before giving a formal description of the algorithm, let’s see some examples.

Example

Compute gcd(482, 1180).

SOLUTION

Divide 482 into 1180. The quotient is 2 and the remainder is 216. Now divide the remainder 216 into 482. The quotient is 2 and the remainder is 50. Divide the remainder 50 into the previous remainder 216. The quotient is 4 and the remainder is 16. Continue this process of dividing the most recent remainder into the previous one. The last nonzero remainder is the gcd, which is 2 in this case:

1180=2482+216482=2216+50216=450+1650=316+216=82+0.

Notice how the numbers are shifted:

remaindertodivisortodividendtoignore.

Here is another example:

12345=111111+123411111=91234+51234=2465+45=14+14=41+0.

Therefore, gcd(12345, 11111)=1.

Using these examples as guidelines, we can now give a more formal description of the Euclidean algorithm. Suppose that a is greater than b. If not, switch a and b. The first step is to divide a by b,  hence represent a in the form

a=q1b+r1.

If r1=0,  then b divides a and the greatest common divisor is b. If r10,  then continue by representing b in the form

b=q2r1+r2.

Continue in this way until the remainder is zero, giving the following sequence of steps:

a=q1b+r1b=q2r1+r2r1=q3r2+r3rk2=qkrk1+rkrk1=qk+1rk.

The conclusion is that

gcd(a, b)=rk.

There are two important aspects to this algorithm:

  1. It does not require factorization of the numbers.

  2. It is fast.

For a proof that it actually computes the gcd, see Exercise 59.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.102.225