Problems on H.C.F. and L.C.M.: formulas & methods

Keep the method clear, then put it into practice.

HCF (gcd) finds the largest common divisor; LCM finds the smallest positive common multiple.

a
Positive integers unless a method states otherwise.
b
Positive integers unless a method states otherwise.
g
HCF or gcd.
L
LCM of the given numbers.

Prime-factor method

HCF: lowest exponents; LCM: highest exponents

Treat a missing prime as having exponent zero.

Two-number identity

gcd(a,b) × lcm(a,b) = ab

For two positive integers only.

Euclidean algorithm

gcd(a,b) = gcd(b, a mod b)

Repeat until remainder 0; the last nonzero remainder is the HCF.

Coprime numbers

If gcd(a,b) = 1, then lcm(a,b) = ab

Coprime numbers need not be prime.

Repeating events

Next simultaneous interval = LCM of periods

All events start together; express periods in the same unit.

Equal remainders

Divisor divides every pairwise difference

For a stated remainder r, use HCF of the numbers minus r; divisor > r.

Explanations and worked examples

Open a method when you need more detail.

Full notation guide
a
Positive integers unless a method states otherwise.
b
Positive integers unless a method states otherwise.
g
HCF or gcd.
L
LCM of the given numbers.
pᵢ
A prime in the combined prime factorisation.
r
A common remainder; the divisor must exceed r.
1. Choose minimum or maximum prime exponents

A common divisor cannot use more copies of a prime than any given number contains. A common multiple must contain enough copies for every number.

HCF: product of primes to minimum exponents
LCM: product of primes to maximum exponents
Worked example

Find the HCF and LCM of 72 and 120.

  1. 72 = 2³ × 3²; 120 = 2³ × 3 × 5.
  2. HCF = 2³ × 3 = 24.
  3. LCM = 2³ × 3² × 5 = 360.

HCF 24; LCM 360.

Remember

  • A prime absent from one number has exponent zero and cannot appear in the HCF.
2. Use repeated division for large numbers

Replacing a pair by the smaller number and the remainder preserves their common divisors. Continue until the remainder is zero.

a = bq + r ⇒ gcd(a,b) = gcd(b,r)
Worked example

Find gcd(252,198).

  1. 252 = 198 + 54.
  2. 198 = 3 × 54 + 36.
  3. 54 = 36 + 18; 36 = 2 × 18.
  4. The last nonzero remainder is 18.

18.

Remember

  • When the first remainder is zero, the smaller number is already the HCF.
3. Connect HCF, LCM and product

For each prime in two numbers, the minimum exponent plus the maximum equals the sum of the exponents. This proves the two-number product identity.

gL = ab
If a = gx and b = gy, then gcd(x,y) = 1
Worked example

Two numbers have HCF 12 and LCM 180. One is 36. Find the other.

  1. Other number = 12 × 180/36 = 60.
  2. Check: gcd(36,60) = 12 and lcm(36,60) = 180.

60.

Remember

  • Do not extend gL = product to three or more numbers. Always verify recovered numbers satisfy both HCF and LCM.
4. Use HCF for the largest equal-sized unit

Cutting lengths into the largest equal pieces without waste requires a piece length dividing every original length. The largest such length is their HCF.

Largest equal piece length = HCF of lengths
Worked example

Ropes 84 cm, 126 cm and 210 cm long are cut into the longest equal pieces without waste. Find the piece length and count.

  1. HCF = 42 cm.
  2. Counts = 84/42 + 126/42 + 210/42 = 2 + 3 + 5.

42 cm; 10 pieces.

Remember

  • Convert all lengths to the same unit before taking the HCF.
5. Use LCM for simultaneous repetitions

When events start together and repeat at fixed periods, the next common occurrence must be a multiple of every period. The least positive one is the LCM.

Next common interval = LCM of periods
Worked example

Three bells ring together now and repeat every 12, 18 and 30 minutes. When will they next ring together?

  1. 12 = 2² × 3; 18 = 2 × 3²; 30 = 2 × 3 × 5.
  2. LCM = 2² × 3² × 5 = 180 minutes.

After 3 hours.

Remember

  • Different starting offsets require congruence conditions; the LCM of periods alone is not enough.
6. Find a divisor from equal remainders

If N₁ and N₂ leave the same remainder on division by d, their difference is a multiple of d. For several distinct numbers, the greatest possible such divisor is the HCF of their differences. If the remainder r is specified, instead calculate the HCF of Nᵢ−r and require d > r.

Unknown common remainder: d_max = gcd of pairwise differences
Specified r: d_max = gcd(N₁−r, N₂−r, …), provided d_max > r
Worked example

Find the greatest divisor that leaves the same remainder when dividing 43, 91 and 183.

  1. Differences from 43 are 48 and 140.
  2. gcd(48,140) = 4.
  3. 43, 91 and 183 each leave remainder 3 modulo 4.

4, with common remainder 3.

Remember

  • If all compared numbers are identical and the remainder is unspecified, there is no greatest divisor. If every number equals the stated remainder r, every divisor greater than r works, so again there is no greatest divisor. Otherwise, reject a candidate not larger than r.
Practise problems on h.c.f. and l.c.m. questions