UNIHIVE

Study Hub UNIPORT MTH 114

MTH 114 · Introduction to Sets, Logic and Algebra

Integers, divisibility and the gcd

The Peano axioms, divisibility, the division algorithm, the Euclidean algorithm, writing the gcd as a combination, the lcm and linear Diophantine equations.

Our notes

1 min read

Peano axioms (in brief)

The natural numbers are built from: 1 is a natural number; every n has a successor n + 1; 1 is not a successor; different numbers have different successors; and the induction axiom: a set containing 1 and closed under successor contains all natural numbers. Induction proofs rest on this axiom.

Divisibility

a divides b (a | b) if b = ak for some integer k. Properties: if a | b and b | c then a | c; if a | b and a | c then a | (bx + cy) for all integers x, y.

Division algorithm

For integers a and b > 0 there are unique q (quotient) and r (remainder) with a = bq + r and 0 ≤ r < b.
Example. −17 = 5 × (−4) + 3, so q = −4, r = 3 (not −2: the remainder must be at least 0).

Euclidean algorithm for the gcd

Worked example: gcd(252, 198).

  1. 252 = 1 × 198 + 54
  2. 198 = 3 × 54 + 36
  3. 54 = 1 × 36 + 18
  4. 36 = 2 × 18 + 0

The last non-zero remainder: gcd = 18. Check: 252 = 18 × 14 and 198 = 18 × 11, and 14 and 11 share no factor. ✓

Bezout: gcd as a combination

Work back up: 18 = 54 − 36 = 54 − (198 − 3 × 54) = 4 × 54 − 198 = 4(252 − 198) − 198 = 4 × 252 − 5 × 198. Check: 1008 − 990 = 18. ✓
lcm: lcm(a, b) = ab ÷ gcd(a, b) = 252 × 198 ÷ 18 = 252 × 11 = 2,772.

Linear Diophantine equations

ax + by = c has integer solutions if and only if gcd(a, b) divides c.
Example. 252x + 198y = 36. gcd 18 divides 36, so solutions exist. Doubling the Bezout identity: x₀ = 8, y₀ = −10 (2016 − 1980 = 36 ✓). General solution: x = 8 + 11t, y = −10 − 14t for any integer t (11 = 198/18, 14 = 252/18). Check t = 1: x = 19, y = −24: 4788 − 4752 = 36. ✓
252x + 198y = 40 has no integer solution, since 18 does not divide 40.

Exams usually ask: find a gcd by the Euclidean algorithm and express it as ax + by; find the lcm; solve a linear Diophantine equation or show it has no solution.

Common mistake: in the general solution, adding multiples of a and b themselves (252 and 198) instead of a/d and b/d. That misses most solutions.

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

Read

Watch

We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.

All MTH 114 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.