Steply

Use the Euclidean algorithm to find gcd(1071, 462)

Step by step, with the reason for every step · Euclid's algorithm · Discrete Math

Step by step

The question

Question: find gcd(1071, 462) by Euclid's algorithm.

gcd(1071, 462)

1 Divide the bigger by the smaller

Divide the bigger number by the smaller: 462 goes into 1071 2 times, and 147 is left over.

1071 = 2 × 462 + 147

Here is the trick.

A number that goes into 1071 and 462 also goes into 147, because 147 is 1071 minus 2 × 462.

So the gcd does not change, and the numbers get smaller.

gcd(1071, 462) = gcd(462, 147)

2 Keep going

Now the same with 462 and 147: the divisor moves left, the remainder becomes the new divisor.

462 = 3 × 147 + 21

147 = 7 × 21, and the remainder is 0.

We stop.

147 = 7 × 21 + 0

3 The last remainder before 0

Careful!

0 only tells us to stop.

The answer is the last remainder before it: 21.

Careful: not gcd(1071, 462) = 0 ✗

The last remainder that is not 0 is 21.

So gcd(1071, 462) = 21.

gcd(1071, 462) = 21

4 Check

21 goes into both: 1071 ÷ 21 is 51, and 462 ÷ 21 is 22.

1071 ÷ 21 = 51, 462 ÷ 21 = 22

And 51 and 22 have no common factor, so nothing bigger than 21 goes into both.

Right!

51 and 22: no common factor

Let's look back.

First: divide the bigger by the smaller.

Then: keep going.

Then: the last remainder before 0.

Last: check.

Answer
gcd(1071, 462) = 21

Your turn

Try this one yourself, then check:

gcd(1070, 458)
Show the answer
gcd(1070, 458) = 2

More from Euclid's algorithm

The whole lesson: Euclid's algorithm →