Learn

Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Lesson 2 of 30

Recover a gcd and the combination that produces it

Prove Euclidean reduction, termination and the Bézout identity.

Loading your saved responses…

Try the optional starting-point checks and targeted refreshers. You can continue directly into this lesson.

Try

Compute gcd(84, 30). Division gives 84=2·30+24, 30=24+6 and 24=4·6. The final nonzero remainder is six. Back substitution gives 6=30−24=3·30−84. Thus the gcd is not just a common divisor: it is an integer combination of the original inputs. Verify the coefficients before generalizing the method.

Predict

Predict why replacing (84, 30) by (30, 24) preserves the gcd. Every common divisor divides the remainder 84−2·30. Conversely, a divisor of 30 and 24 divides their combination 84. The argument works in both directions. A procedure that merely produces a common divisor has not yet proved that it is the greatest one.

Experiment

Track remainder identities alongside their origin.

RemainderCombination of 84 and 30
841·84+0·30
300·84+1·30
241·84−2·30
6−1·84+3·30

Apply the same update to coefficient pairs that you apply to remainders. Then change the inputs to 85 and 30 and find the new gcd and combination. This tests the invariant rather than memorizing one trace.

Understand

For positive current divisor b, division produces 0≤r< b, so nonzero remainders strictly decrease. The Euclidean algorithm therefore terminates. The common-divisor invariant holds at each step, and at the final pair (d, 0), the positive gcd is d. Back substitution proves d=ua+vb. An independent proof chooses the least positive integer combination: dividing each input by that least positive d leaves a smaller nonnegative combination, so the remainder must vanish. Every common divisor divides d. This establishes the Bézout characterization without relying on the algorithm’s particular quotients.

Apply

If gcd(a, b)=1 and a divides bc, multiplying ua+vb=1 by c shows a divides c. This is a cancellation theorem with a hypothesis, not permission to cancel arbitrary factors in divisibility. For example, 6 divides 3·2 but does not divide 2 because gcd(6, 3)≠1. Bézout also provides modular inverses: ua+vm=1 means ua≡1 modulo m. If the gcd is larger than one, such an inverse cannot exist. The same identity supports proofs about primes and solutions of linear Diophantine equations.

The back-substitution coefficients are not unique. If ax+by=g and a, b are nonzero, replacing x by x+(b/g)t and y by y−(a/g)t preserves the identity for every integer t. This is the same freedom that appears in linear Diophantine equations. A computer trace should therefore verify the identity and gcd, not insist on one particular pair of coefficients. Negative inputs can be handled by first running the nonnegative remainder algorithm on absolute values and then restoring the signs in the coefficients. The special pair a=b=0 has gcd convention zero but has no least positive linear combination.

Continue

An extended Euclidean program should return the positive gcd and coefficients whose exact combination is checked independently. Include zero inputs, negative inputs and equal inputs, while treating (0, 0) according to an explicit convention. Work grows with the input size; counting remainder steps is different from counting bit operations on large integers. The next lesson uses the coprime-cancellation lemma to prove prime-factorization uniqueness, rather than assuming uniqueness to justify the gcd algorithm.

Return to the number theory unit to choose a targeted retry. Continue with prove that prime factors cannot hide inside a product.

Apply · explain · revise

Practice and reasoning

Drafts save locally as you type. Reveal worked solutions when useful; the site remembers that exposure. Automatic matches check the requested answer, while written arguments require review against the rubric.

Find gcd(252, 198).

Integers, fractions and finite decimals are accepted. Expressions such as sqrt(2) are not parsed by this checker.

Find the least positive inverse of 7 modulo 26.

Integers, fractions and finite decimals are accepted. Expressions such as sqrt(2) are not parsed by this checker.

Prove gcd(a, b)=gcd(b, a−qb).

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Use the least positive integer combination to prove Bézout for a, b not both zero.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

If gcd(a, b)=1 and a|bc, prove a|c.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Specify invariants for an extended Euclidean implementation.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Reflect and continue

Before marking this lesson complete, explain one key idea without the worked solution and identify a condition that matters. Marking complete records participation, not independent mastery.