Skip to content
Back to exploration
Discrete mathematics / Chinese

輾轉相除法完整解析|原理+實作步驟+範例教學|最大公因數 GCD 快速求法

NUMA數之本 · YouTube · 2:44

Open original
READ & KEEP

The explanation, unpacked.

Reviewed learning material · Video analysis · English
Read the full overview

This segment introduces the Euclidean algorithm for finding the greatest common divisor (GCD) of two positive integers. The video first demonstrates the operational flow of the algorithm by calculating the GCD of 5911 and 4369: repeatedly performing "divide the larger number by the smaller number to get the remainder" until the remainder is zero, with the last divisor being the answer. Subsequently, the video elaborates on the mathematical principles behind the algorithm—the Division Principle (a=bq+r) and the resulting GCD reduction property ((a,b)=(b,r)). Although the proof process in the video is somewhat simplified (only proving the one-way divisibility relationship), it clearly explains why the algorithm works and applies the theory back to the initial numerical example for verification.

Use the learning inspector for key ideas and moments, or open the reading tabs for the complete notes.

Chapters

0:00Title and Introduction0:03Euclidean Algorithm Definition and Practical Calculation1:03Mathematical Principles: Division Principle and GCD Properties1:53Application of Principles and Result Verification

Learning script

Generated from the video's visuals and explanation; not verbatim speech.

The video begins by directly stating the topic: the Euclidean algorithm is used to find the greatest common divisor of two numbers. Facing larger numbers like 4369 and 5911, it is difficult to judge common factors by eye, so a systematic algorithm is needed.

Next, it introduces the core operational rule of the algorithm: repeatedly execute "divide the larger number by the smaller number", record the remainder, and then continue dividing using the previous divisor and the new remainder, until the remainder on one side becomes zero.

Now we enter the practical calculation stage. First compare 5911 and 4369; since 5911 is larger, divide 5911 by 4369. The calculation yields a quotient of 1 and a remainder of 1542. This step is clearly presented on the screen as a long division.

Next, take the previous divisor 4369 and divide it by the remainder 1542. This time the quotient is 2, and the remainder becomes 1285. Note how the numbers are passed down step by step.

Continue this process, dividing 1542 by 1285. The quotient is 1, and the remainder shrinks to 257. You can see the values decreasing rapidly, which reflects the efficiency of the algorithm.

In the final step, divide 1285 by 257. This time it divides evenly, with a quotient of 5 and a remainder of 0. According to the rule, when the remainder is 0, the last divisor, 257, is the greatest common divisor we are looking for.

After finishing the example, the video turns to theoretical explanation. Why is this correct? It is based on the "Division Principle". For any a divided by b equaling q with remainder r, it can be written as the equation a = bq + r. This is the foundation of number theory.

Based on the Division Principle, a key property is introduced: the greatest common divisor of a and b is actually equal to the greatest common divisor of b and the remainder r. That is to say, finding gcd(a, b) can be transformed into finding the smaller gcd(b, r).

To illustrate this, assume the greatest common divisor of a and b is m. Then a can be written as m times some integer k1, and b can be written as m times k2. Substitute them into the equation a = bq + r.

After rearranging terms, we get r=m(k1−k2q)r = m(k1 - k2q). Since everything inside the parentheses is an integer, this shows that m also divides r. Since m is a divisor of b, and now it is proven to be a divisor of r, m is naturally also a common divisor of b and r.

Having finished the theory, let's look back at the numbers from earlier. Because 5911=4369×1+15425911 = 4369 \times 1 + 1542, the greatest common divisor of (5911, 4369) is equal to that of (4369, 1542). This corresponds to the first step of the algorithm.

Similarly, treating 4369 and 1542 as the new a and b, their greatest common divisor is equal to the next pair (1542, 1285). This chain of equivalences continues.

Finally, the pair becomes (1285, 257). Because 1285 is divisible by 257, their greatest common divisor is obviously 257. This perfectly explains why the long division calculation earlier yielded the correct answer.

Knowledge cards

01

Definition of Euclidean Algorithm

A method for finding the greatest common divisor of two positive integers. The operational steps are: divide the larger number by the smaller number to get the remainder, then use the divisor and remainder as the new pair of numbers to continue dividing, repeating this process until the remainder is 0. The last non-zero divisor is the greatest common divisor.

02

Division Principle

For integer a and positive integer b, there exist unique integers q (quotient) and r (remainder) satisfying a = bq + r and 0≤r<b0 \le r < b. This is the legal basis for each step of the Euclidean algorithm.

a=bq+r,0≤r<ba = bq + r, \quad 0 \le r < b
03

GCD Reduction Property

If a = bq + r, then the greatest common divisor of a and b is equal to the greatest common divisor of b and r. This allows us to transform finding the GCD of large numbers into finding the GCD of smaller numbers, thereby achieving iterative convergence of the algorithm.

(a,b)=(b,r)(a, b) = (b, r)
04

Example Calculation: gcd(5911, 4369)

Demonstrates the algorithm process through four steps of division: 1. 5911 ÷ 4369=14369 = 1 ... 1542 2. 4369 ÷ 1542=21542 = 2 ... 1285 3. 1542 ÷ 1285=11285 = 1 ... 257 4. 1285 ÷ 257=5257 = 5 ... 0 Conclusion: The greatest common divisor is 257.

05

Theoretical Proof Idea (One-way)

Let m = gcd(a, b), then a=mk₁, b=mk₂. Substituting into a=bq+r gives mk₁ = mk₂q+rq + r, rearranging gives r=mr = m(k₁-k₂q). This proves that m is also a divisor of r. Combined with m|b, we know m is a common divisor of b and r. (Note: A complete proof requires supplementing the reverse deduction).

r=m(k1−k2q)r = m(k_1 - k_2q)

Detailed learning notes

Explore conditions, steps and evidence. Supplementary explanations are labeled separately from content shown in the video.

Symbols · 8

a

Clear evidence
Shown in the video
Evidence
  1. Formula
    Observation

    The whiteboard displays a ÷ b=qb = q ... r and a = bq + r

Symbol

a

Meaning

Dividend

Domain

Positive integer

b

Clear evidence
Shown in the video
Evidence
  1. Formula
    Observation

    The whiteboard displays a ÷ b=qb = q ... r and a = bq + r

Symbol

b

Meaning

Divisor

Domain

Positive integer

q

Clear evidence
Shown in the video
Evidence
  1. Formula
    Observation

    The whiteboard displays a ÷ b=qb = q ... r

Symbol

q

Meaning

Quotient

Domain

Non-negative integer

r

Clear evidence
Shown in the video
Evidence
  1. Formula
    Observation

    The whiteboard displays a ÷ b=qb = q ... r and a = bq + r

Symbol

r

Meaning

Remainder

Domain

Non-negative integer

(a, b)

Clear evidence
Shown in the video
Evidence
  1. Formula
    Observation

    The whiteboard displays (a, b) = (b, r)

Symbol

(a, b)

Meaning

Greatest common divisor of a and b

Domain

Pair of positive integers

m

Clear evidence
Shown in the video
Evidence
  1. Formula
    Observation

    The whiteboard displays Let (a, b) = m

Symbol

m

Meaning

Assumed greatest common divisor of a and b

Domain

Positive integer

k1k_1

Clear evidence
Shown in the video
Evidence
  1. Formula
    Observation

    The whiteboard displays a = mk_1

Symbol

k1k_1

Meaning

Integer factor after dividing a by m

Domain

Integer

k2k_2

Clear evidence
Shown in the video
Evidence
  1. Formula
    Observation

    The whiteboard displays b = mk_2

Symbol

k2k_2

Meaning

Integer factor after dividing b by m

Domain

Integer

Knowledge points · 3

Definition and Operational Steps of the Euclidean Algorithm

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    The speaker explains that the Euclidean algorithm is used to find the greatest common divisor of two numbers, by repeatedly dividing the larger number by the smaller one until one side becomes zero.

  2. Diagram
    Observation

    The left side of the screen shows the numbers 4369 and 5911, with lines drawn to separate columns.

Definition
Explanation

The Euclidean algorithm is a method for calculating the greatest common divisor (GCD) of two positive integers. Its core operation involves dividing the larger number by the smaller number to obtain a remainder, then using the original divisor and the new remainder as the dividend and divisor for the next round. This process repeats until the remainder is zero. At this point, the last non-zero divisor is the GCD of the two numbers.

Formula
Conditions
  1. Applicable to two positive integers

  2. Each division yields a non-negative remainder

  3. Termination condition is when the remainder equals zero

Division Principle

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    The speaker mentions that the Euclidean algorithm is based on the Division Principle.

  2. Formula
    Observation

    The whiteboard displays a ÷ b=qb = q ... r and a = bq + r.

Formula
Explanation

For any integer a and positive integer b, there exist unique integers q and r such that a = bq + r and 0≤r<b0 \le r < b. Here, q is called the quotient and r is called the remainder. This is the mathematical basis for each step of the Euclidean algorithm.

Formula
a=bq+r,0≤r<ba = bq + r, \quad 0 \le r < b
Conditions
  1. b is a positive integer

  2. r is a non-negative integer less than b

Reduction Property of Greatest Common Divisor

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    The speaker explains that the GCD of a and b is equal to the GCD of b and r, and provides a proof.

  2. Formula
    Observation

    The whiteboard displays (a, b) = (b, r), and derives r=m(k1−k2q)r = m(k_1 - k_2q).

Uncertainties
  1. The video only proves that m is also a divisor of r, thereby concluding that the GCD of (b, r) is at least m, but it does not strictly prove that no common divisor larger than m exists (i.e., the reverse inclusion is not proven).

Method
Explanation

If a = bq + r, then the GCD of a and b is equal to the GCD of b and r. This means that when finding the GCD, the larger pair (a, b) can be replaced by the smaller pair (b, r), thereby gradually reducing the problem size.

Formula
(a,b)=(b,r)where a=bq+r(a, b) = (b, r) \quad \text{where } a = bq + r
Conditions
  1. a, b, q, r are integers

  2. a = bq + r

Prerequisites
  1. Division Principle
Claims and conditions · 1

GCD Equality Theorem

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    The speaker asserts that the GCD of a and b is equal to the GCD of b and r.

  2. Formula
    Observation

    The whiteboard displays (a, b) = (b, r).

Uncertainties
  1. The proof in the video only shows that common divisors of (a,b) are also divisors of (b,r), without fully proving the equality of the sets in both directions, but the conclusion itself is a correct standard theorem.

Theorem
Statement

For integers a, b, q, r satisfying a = bq + r, gcd(a, b) = gcd(b, r).

Hypotheses
  1. a = bq + r

Quantifiers

For all integers a, b, q, r satisfying the condition

Derivations and proofs · 1

Proof of GCD Reduction Property (One-way)

Clear evidence
Shown in the video
Evidence
  1. Formula
    Observation

    The whiteboard sequentially writes: Let (a,b)=m, a=mk_1, b=mk_2, substituting into a=bq+r gives mk_1 = mk_2q + r, rearranging gives r=m(k1−k2q)r = m(k_1 - k_2q).

Uncertainties
  1. The proof is incomplete, showing only m | r, not gcd(b,r) | m.

Proof
Steps
  1. Expression
    設 (a,b)=m\text{設 } (a, b) = m
    Explanation

    Assume the greatest common divisor of a and b is m.

    Justification

    Definition

    Shown in the video
  2. Expression
    a=mk1,b=mk2a = mk_1, \quad b = mk_2
    Explanation

    According to the definition of GCD, both a and b are divisible by m.

    Justification

    Definition of divisibility

    Shown in the video
  3. Expression
    a=bq+r  ⟹  mk1=mk2q+ra = bq + r \implies mk_1 = mk_2q + r
    Explanation

    Substitute the expressions for a and b into the Division Principle equation.

    Justification

    Substitution

    Shown in the video
  4. Expression
    r=mk1−mk2q=m(k1−k2q)r = mk_1 - mk_2q = m(k_1 - k_2q)
    Explanation

    Rearrange terms and factor out m.

    Justification

    Algebraic manipulation

    Shown in the video
  5. Expression
    m∣rm \mid r
    Explanation

    Since k1k_1, k2k_2, and q are integers, (k1−k2qk_1 - k_2q) is an integer, so m divides r.

    Justification

    Definition of divisibility

    Shown in the video
Conclusion

The video concludes that m is also a divisor of r, therefore the GCD of b and r includes at least m (the video states 'it will be m', omitting the rigorous two-way argument).

Worked examples · 2

Using the Euclidean Algorithm to Find GCD of 5911 and 4369

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    The whiteboard displays the complete long division process: 5911÷4369 remainder 1542, 4369÷1542 remainder 1285, 1542÷1285 remainder 257, 1285÷257 remainder 0.

  2. Audio
    Observation

    The speaker reads out the result of each division step synchronously.

Problem

Calculate gcd(5911, 4369).

Given
  1. a=5911a = 5911

  2. b=4369b = 4369

Goal

Find the greatest common divisor of the two numbers.

Steps
  1. Expression
    5911=4369×1+15425911 = 4369 \times 1 + 1542
    Explanation

    Divide the larger number by the smaller number, quotient 1, remainder 1542.

    Justification

    Division Principle

    Shown in the video
  2. Expression
    4369=1542×2+12854369 = 1542 \times 2 + 1285
    Explanation

    Divide the previous divisor 4369 by the remainder 1542, quotient 2, remainder 1285.

    Justification

    Division Principle

    Shown in the video
  3. Expression
    1542=1285×1+2571542 = 1285 \times 1 + 257
    Explanation

    Divide the previous divisor 1542 by the remainder 1285, quotient 1, remainder 257.

    Justification

    Division Principle

    Shown in the video
  4. Expression
    1285=257×5+01285 = 257 \times 5 + 0
    Explanation

    Divide the previous divisor 1285 by the remainder 257, quotient 5, remainder 0.

    Justification

    Division Principle

    Shown in the video
Answer

gcd(5911, 4369) = 257

Verification

When the remainder is 0, the divisor 257 is the greatest common divisor.

Verifying Calculation Results Using the Reduction Property

Clear evidence
Shown in the video
Evidence
  1. Formula
    Observation

    The whiteboard displays (5911, 4369) = (4369, 1542) = (1542, 1285) = (1285, 257) = 257.

  2. Audio
    Observation

    The speaker explains how to apply the theory to the specific numbers from earlier, replacing pairs step by step.

Problem

Explain why the above long division calculation yields the correct greatest common divisor.

Given
  1. Previous long division results

  2. Theorem (a, b) = (b, r)

Goal

Establish the equivalence chain between number pairs.

Steps
  1. Expression
    (5911,4369)=(4369,1542)(5911, 4369) = (4369, 1542)
    Explanation

    Because 5911=4369×1+15425911 = 4369\times 1 + 1542.

    Justification

    GCD Reduction Property

    Shown in the video
  2. Expression
    (4369,1542)=(1542,1285)(4369, 1542) = (1542, 1285)
    Explanation

    Because 4369=1542×2+12854369 = 1542\times 2 + 1285.

    Justification

    GCD Reduction Property

    Shown in the video
  3. Expression
    (1542,1285)=(1285,257)(1542, 1285) = (1285, 257)
    Explanation

    Because 1542=1285×1+2571542 = 1285\times 1 + 257.

    Justification

    GCD Reduction Property

    Shown in the video
  4. Expression
    (1285,257)=257(1285, 257) = 257
    Explanation

    Because 1285=257×5+01285 = 257\times 5 + 0, 257 divides 1285.

    Justification

    Divisibility Property

    Shown in the video
Answer

257

Verification

The final result matches the long division calculation.

Visual events · 3

Video Title Card

Clear evidence
Shown in the video
Evidence
  1. Diagram
    Observation

    Displays the title "Euclidean Algorithm" and a cartoon character.

Objects
  1. Text: Euclidean Algorithm

  2. Cartoon character

Invariants
  1. Static image

Interpretation

Introduction to the topic.

Euclidean Algorithm Long Division Demonstration

Clear evidence
Shown in the video
Evidence
  1. Animation
    Observation

    As the speaker explains, the numbers for the long division appear sequentially on the whiteboard: 1, 4369, 1542; 2, 3084, 1285; 1, 1285, 257; 5, 1285, 0.

Objects
  1. Numbers 5911, 4369

  2. Long division structure

Changes
  1. Remainder changes from 1542 to 1285, then to 257, and finally to 0

  2. Divisor updates to the previous remainder

Invariants
  1. Each operation is Larger Number ÷ Smaller Number

Interpretation

Visually demonstrates the iterative process of the algorithm until the remainder is zero.

Principle Derivation Board Work

Clear evidence
Shown in the video
Evidence
  1. Animation
    Observation

    The whiteboard writes out the Division Principle formula and the derivation of GCD equality line by line.

Objects
  1. Variables a, b, q, r, m, k1k_1, k2k_2

  2. Equations

Changes
  1. Transition from concrete calculations to abstract symbolic derivation

Invariants
  1. Logical order: Definition -> Assumption -> Substitution -> Conclusion

Interpretation

Shows the number theory foundation behind the algorithm.

Misconceptions · 1

Missing Proof Direction

Clear evidence
Supplementary explanation
Evidence
  1. Audio
    Observation

    The speaker says, 'So m is also one of the divisors of r... the GCD of b and r will be m'.

Misconception

Believing that proving only that divisors of gcd(a,b) are also divisors of gcd(b,r) implies they are equal.

Clarification

A rigorous proof requires bidirectional deduction: proving both gcd(a,b) | gcd(b,r) and gcd(b,r) | gcd(a,b) to establish equality. The video only shows the former (m | r); although the conclusion is correct, the argument is mathematically incomplete.

Concept relations · 2

Division Principle → Definition and Operational Steps of the Euclidean Algorithm

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    The speaker explicitly states that the Euclidean algorithm is based on the Division Principle.

Prerequisite
Explanation

The Division Principle provides the mathematical legitimacy and uniqueness guarantee for each step of 'dividing the larger by the smaller to get the remainder' in the Euclidean algorithm.

Reduction Property of Greatest Common Divisor → Definition and Operational Steps of the Euclidean Algorithm

Clear evidence
Shown in the video
Evidence
  1. Formula
    Observation

    The (a,b)=(b,r) on the whiteboard directly supports the iterative logic of the algorithm.

Application
Explanation

The reduction property of the GCD is the fundamental reason why the Euclidean algorithm can solve the problem by continuously reducing the size of the number pairs.

Find an answer · 2

How to use the Euclidean algorithm to calculate the greatest common divisor of two large integers?

Clear evidence
Shown in the video
Evidence
  1. Audio
    Observation

    Detailed explanation of operational steps and example calculation.

Knowledge points
  1. Definition and Operational Steps of the Euclidean Algorithm
  2. Using the Euclidean Algorithm to Find GCD of 5911 and 4369

What is the mathematical principle behind the Euclidean algorithm? Why is (a,b) equal to (b,r)?

Clear evidence
Shown in the video
Evidence
  1. Formula
    Observation

    Derivation of the Division Principle and GCD properties.

Knowledge points
  1. Division Principle
  2. Reduction Property of Greatest Common Divisor
  3. Proof of GCD Reduction Property (One-way)
Coverage and review notes

Covered · Title page, no mathematical content.

Covered · Algorithm definition and specific numerical example calculation.

Covered · Theoretical foundation and property derivation.

Covered · Verification process applying theory back to the example.

Covered · Ending black screen.

Explore the knowledge in this video

Open video knowledge graph →

  • Euclidean algorithm ExplanationAt 0:00
    Why this connection?

    The full lesson computes a remainder chain and states gcd(a,b)=gcd(b,r). From 81 to 113 seconds it proves only that a common divisor of a and b divides r; the reverse direction is omitted, so this is an explanation rather than a complete proof.

  • Greatest common divisor ApplicationAt 0:23
    Why this connection?

    From 23 to 63 seconds, the board gives four verified divisions, reaches 1285=257⋅5+01285=257\cdot 5+0 and reads 257 as gcd(5911,4369).