and more generally with the integers:
but
If a
b then we also say: a is a divisor
(or factor) of b, or that: b is a multiple
of a. For example, if b = 12 then the divisors (factors)
of b are
Aside: Don´t confuse the divides symbol:(which is a vertical stroke with a little space around it) with the slash symbol: / (which separates the numerator and denominator of a fraction). Also, note that despite the symmetry of the symbol:
the symbol cannot be used in reverse, i.e. a
b and b
a mean different things (in fact, if they are both true then a = ± b).
Property 1.
If a
b and a
c then
a
bx + cy for any integers x,y.
Proof:
Suppose a
b and a
c. Then b = aq and c = ar
for some integers q,r. So, for any integers x,y,
and qx + ry is an integer, and hence a
bx + cy.
Aside: Notice that 1 is neither prime nor composite. In fact, 1 is called a unit (the technical term for a number that divides all integers).What makes primes so interesting is that every natural number (other than 1) can be expressed in just one way (except that we may be able to arrange the factors in many ways) as the product of prime divisors, e.g.
Such a factorisation is called a prime decomposition.
Aside: If we were to include 1 as a prime then 74844 = 15.22.35.7.11, say, would be ``another prime decomposition''. Excluding 1 as a prime ensures the uniqueness of prime decompositions.The above fact is so important it is given a special name. Let´s give it its name and recap what it says:
Fundamental theorem of arithmetic. Any natural number n, other than 1, can be written uniquely as follows:
where k is a natural number, each pi is a prime number and 1 < p1 < p2 < ... < pk, and each ei is a natural number.
A fundamental property of primes is expressed in the following result:
Euclid's Lemma.
If a prime p divides ab then p
a or p
b.
How can we decide whether a given, possibly quite large,
natural number n is prime? Well ... if n is composite
then n = ab for some natural numbers a,b such that neither a nor b
is 1 or n; and either a = b =
n or one of a or b is less
than
n. Thus, to show n is prime we need only show it has
no prime divisors less than or
equal to
n.
Example 1. 97 is prime, since
Remark. The primes less than 100 are:
This is easy to check, because at most we need only check divisibility by 2, 3, 5 and 7. Incidentally, there are 25 of them!
Aside: If (a,b) = 1 then a,b are said to be relatively prime or coprime.You may be familiar with an algorithm for finding the gcd of two integers a,b which involves first finding the prime decompositions of a,b. While this procedure works well when a,b are small (particularly, if both a and b are smaller than 100, say), it is quite inefficient if a,b are large; since, in general, finding prime decompositions is difficult.
Aside: The difficulty of finding prime decompositions is exploited in many encryption algorithms.Below, we will see a method for finding greatest common divisors that doesn´t require finding prime decompositions. The method requires application of the Division Algorithm (usually, several times) which we now describe.
Division Algorithm.
For integers a,b with a
0 there exist integers q (the
quotient) and r (the remainder) such that
Essentially q,r are the numbers that make the following division work:
| q | rem. | r|
| a ) | b | |
| | ||||
Let´s apply the Division Algorithm to a few examples:
| if | a = 7 | and | b = 22 | we write | 22 = 7.3 + 1 | (so q = 3 and r = 1); |
| if | a = 113 | and | b = 355 | we write | 355 = 113.3 + 16 | (so q = 3 and r = 16); |
| if | a = 8 | and | b = 72 | we write | 72 = 8.9 + 0 | (so q = 9 and r = 0). |
Aside: Observe that r = 0 precisely when aThe greatest common divisor d of two integers a,b has three interesting properties:b; and that r > 0 if a
b.
Example 2. To find the gcd of 234 and 180, perform the following steps.
| 234 | 180 | | 1 | 180 | 162 | 3 |
| | 54 | 18 |
| | |||
Here 180 was divided into 234, it went once remainder 54; then 54 was divided into 180, it went 3 times remainder 18; and 18 divides 54 (so we stop) ... and so 18 is the gcd of 234 and 180. \par Working backwards we can also find x,y such that 234x + 180y = 18:
| 18 | = 180 - 162| | = 180 - 3.54 | | = 180 - 3(234 - 1.180) | | = 4.180 - 3.234.
| |
So x = 4 and y = -3 is one possibility. All pairs x,y satisfy
| x | = 4 + 13t| y | = -3 - 10t
| |
for some integer t.
Aside: To see the existence of other pairs x,y satisfying 234x + 180y = 18, observe that
18 = 4.180 - 3.234
= 4.180 - 3.234 + (234.180/18 )t -(234.180/18 )t
= (4 + 234/18 t).180 + ( - 3 - 180/18 t).234
= (4 + 13t).180 + ( - 3 - 10t).234.
What if the right - hand side of the above equation is not d? i.e. can we still solve
for x,y when c
d?
The question is answered by the theorem, below.
Aside: Equations of the form: ax + by = c are examples of Diophantine Equations (after Diophantus, an ancient Greek who was the first known to study them).We will need the following lemma to prove the theorem.
Lemma.
If
,
are non - zero relatively prime integers
then all integer solutions of
X +
Y = 0
for X,Y are of form
| X | = | Y | = - | |
where t
Z.
Proof:
Assume
,
Z,
,
0 and (
,
) = 1.
Rearranging
X +
Y = 0, we obtain
So
-
X,
and since (
,
) = 1 we must have
X,
i.e. X =
t for some integer t, whence Y = -
t.
Theorem.
Let a,b,c
Z with a,b not both zero, and suppose
d = (a,b). Then ax + by = c has a solution for x,y
if and only if d
c.
Moreover, if a,b are both non - zero, d
c,
and x0,y0 is one solution
of ax + by = c then all possible solution pairs are of form
| x | = x0 + | y | = y0 - | |
where
= a/d,
= b/d and t
Z.
(A `starting solution' x0,y0 is
| x0 | = x´q| y0 | = y´q
| |
where q = c/d and x´,y´ is a solution of ax + by = d and may be obtained by applying the Euclidean Algorithm to a,b.)
Proof:
If there is a solution then ax + by = c for some integers x,y.
Now d
a and d
b, so d
ax + by = c
by Property 1.
Now we prove the converse direction. Suppose d
c
(so that c = dq for some integer q). From the Euclidean
Algorithm we can find integers x´,y´ such that
Hence
That is, a solution of ax + by = c exists (since x0 = x´q, y0 = y´q is a solution). Now let us find the general solution when solutions exist. Suppose x,y is a solution. Then we have
| ax + by | = c| ax0 + by0 | = c,
| |
whence on subtracting the equations we obtain
and on dividing by d, we get
where
= a/d,
= b/d and we have
,
relatively prime and both non - zero. So by the lemma the general
solution for x - x0, y - y0 is given by
| x - x0 | = | y - y0 | = - | |
where t
Z, which on rearranging gives the general
solution stated in the theorem.
Aside: When giving the general solution in the case where dc, the theorem required that both a,b be non - zero ... but if one checks the given solutions still work if one or other of a,b is zero. So why include the restriction? ... The trouble is there are other solutions, e.g. suppose b = 0, i.e. we wish to solve ax + 0.y = c where d = a
c. Then the solution for x is correct but notice it is just a complicated way of writing x = c/a, but y is allowed to be any integer (whereas the solution `suggests' some integers don't work ... depending on what choice you take for y0).