An algorithm is a finite list of clear steps. Euclid’s algorithm finds the HCF by repeated division; others add, convert to binary or find primes.
| Division step | a = bq + r, with 0 ≤ r < b |
| Euclid | HCF(a, b) = HCF(b, r) |
| HCF and LCM | HCF(a, b) × LCM(a, b) = a × b |
| Three numbers | HCF(a, b, c) = HCF(HCF(a, b), c) |
Write 118 in binary by repeated division by 2.
Working: 118 ÷ 2 = 59 r 0; 59 ÷ 2 = 29 r 1; 29 ÷ 2 = 14 r 1; 14 ÷ 2 = 7 r 0; 7 ÷ 2 = 3 r 1; 3 ÷ 2 = 1 r 1; 1 ÷ 2 = 0 r 1; read the remainders upwards
Answer: 1110110