Discrete Mathematics and Graphs · BE5B01DMG · Topic 6 of 12
Divisibility, Euclid and Diophantine equations
Repeated division computes gcd; back substitution turns it into an integer linear combination.
Key ideas
Division with remainder
For n>0, write any integer m uniquely as qn+r with 0≤r<n. This also works for negative m.
Euclidean algorithm
Replace the pair by divisor and remainder. For 48 and 18: 48=2·18+12, 18=12+6, 12=2·6. The last nonzero remainder is 6.
Bézout identity
Read the divisions backwards: 6=18−12=3·18−48. Thus gcd(a,b) is an integer combination of a and b.
All integer solutions
The equation ax+by=c is solvable exactly when d=gcd(a,b) divides c. For nonzero a,b and a particular solution (x₀,y₀), add the homogeneous solution.
In one line: Check gcd divisibility before spending time finding a particular solution.
Formulas
- Division with remainder
- Euclidean algorithm
- Bézout identity
- All integer solutions
Practice with worked solutions
Question 1
Compute gcd(48,18) using Euclid’s algorithm.
Worked solution
Answer: 6
The last nonzero remainder is 6.
Question 2
Find gcd(84,126).
Worked solution
Answer: 42
126−84=42 and 84 is twice 42.
Question 3
Compute gcd(1071, 462) with the Euclidean algorithm.
Worked solution
Answer: 21
Divide repeatedly and replace the pair by (divisor, remainder) until the remainder is 0.
More Discrete Mathematics and Graphs practice in Ucenly
Sources
Written by Ucenly. Based on the BE5B01DMG course materials:
- 3 Number Theory, p. 2, 5, 6, 8
- 3 Number Theory - tutorial 2026, p. 4, 17
- Sample Exam, p. 1