Divisibility and the greatest common divisor
Divisibility notation and properties, the division algorithm, and the Euclidean algorithm for computing a greatest common divisor.
- State the four basic properties of divisibility, including transitivity and the linear-combination property.
- Apply the division algorithm to write any integer as a=qn+r with 0<=r<n.
- Compute gcd(a, b) by hand using the Euclidean algorithm.
12 min readJump to the quiz ↓
Divisibility means no remainder, and it survives any combination
Every later idea in this module rests on one question: does one number split evenly into another? RSA key generation depends on it directly. An encryption exponent only has a working decryption partner because . Modular inverses and the extended Euclidean algorithm on the next page start from the same machinery.
A non-zero integer divides if for some integer , so dividing by leaves no remainder. This is written , and is a divisor of . For example, because , and because .
Four properties follow directly from the definition:
- If , then .
- If and , then .
- Any divides .
- Transitivity: if and , then .
Transitivity holds because and mean and for some integers . Substituting the first into the second gives , so . The lecture gives two instances: and give ; and give .
A stronger property extends this to combinations. If and , then divides for any integers and , not just or . This is the linear combination property. The lecture’s example: and , so divides for any . Writing and , which is a multiple of whatever and are.
Recall
Why does 11 | 66 and 11 | 77 guarantee 11 divides m·66 + n·77 for every integer m and n?
Because and for some integers . Substituting, , which is times an integer, so divides it whatever and are.
The division algorithm gives a unique quotient and a non-negative remainder
The division algorithm formalises ordinary long division. For a positive integer and a non-negative integer , is the quotient, is the remainder, and is the floor function: the greatest integer no larger than the argument. The remainder is always non-negative and strictly less than . That constraint is what makes and unique for a given and .
Formula
Division algorithm
- the dividend
- the divisor (positive)
- the quotient
- the remainder, 0 <= r < n
Pitfall
, not rounded or truncated toward zero. For non-negative and positive these agree, but do not carry the habit of “round toward zero” into modular arithmetic on the next page, where negative dividends make the two rules disagree.
The Euclidean algorithm finds the gcd by repeated division
The greatest common divisor of and , , is the largest integer that divides both: . The definition requires a positive result, so . Every integer divides , so , and is defined to be .
Two integers are relatively prime if their only common positive divisor is , equivalently .
Exam detail
Neither number has to be prime itself. and are relatively prime: the divisors of are , the divisors of are , and is the only entry on both lists.
The Euclidean algorithm finds by repeated application of the division algorithm: replace with and repeat until the remainder is . The last non-zero remainder is the gcd. Each remainder is smaller than the last, so the algorithm always terminates.
Try it — worked example
Use the Euclidean algorithm to find gcd(710, 310).
Show answer and steps
Answergcd(710, 310) = 10
The lecture names this exact example, but the figure showing its working did not survive extraction from the source PDF. The steps below apply the division algorithm repeatedly, exactly as defined above.
- : divide 710 by 310, quotient 2, remainder 90.
- : repeat on (310, 90).
- : repeat on (90, 40).
- : the remainder is 0, so the algorithm stops.
- The last non-zero remainder was , so .
Check yourself
Source
Week 4 Number Theory PDF