This article was automatically translated from the original Turkish version.
Euclidean algorithm is one of the oldest and most fundamental algorithms in the history of arithmetic, used to compute the greatest common divisor (GCD) of two positive integers. The algorithm derives its name from the Alexandrian mathematician Euclid, and its core principles are based on Propositions 1 and 2 in Book VII of his work Elements.
In Euclid’s Elements the algorithm is described as a process for finding a common measure of two magnitudes. In ancient Greek mathematics, numbers were represented as line segments (magnitudes). The algorithm operates through the process of "successive subtraction" (anthyphairesis): the smaller number is repeatedly subtracted from the larger one until the remainder divides the other exactly.
Euclid formalizes this process in Book VII, Proposition 2 as follows:
In modern mathematical notation, the Euclidean algorithm is expressed using successive division (the division algorithm). Let and () be two positive integers. The algorithm proceeds as follows:
1. , where
2. , where
3. , where
4. Continue this process until .
The last nonzero remainder () is the greatest common divisor of and .
The correctness of the algorithm relies on the theorem: "If , then ."
1. If a number divides both and ( and ), then it must also divide . Therefore, every common divisor of and is also a common divisor of and .
2. Conversely, any number that divides both and must also divide .
3. Since the sets of common divisors are identical, their greatest common divisors must also be identical. The algorithm terminates because the sequence of remainders decreases strictly () and is finite.
The efficiency of the algorithm is analyzed through its relationship with the Fibonacci sequence. As proven by Gabriel Lamé in 1844, the number of steps in the Euclidean algorithm never exceeds approximately five times the number of decimal digits of the smaller number. The worst-case scenario occurs when computing the GCD of two consecutive Fibonacci numbers, because the quotients () are always 1 and the remainders decrease at the slowest possible rate.
The Euclidean algorithm is widely used, from reducing rational numbers to their simplest form to modular arithmetic operations in cryptography. Additionally, it serves as a structural tool in solving topological problems such as the classification of rational tangles (rational tangles), by computing the GCD of numerator and denominator.
Euclid. *Euclid's Elements of Geometry*. Translated by Richard Fitzpatrick. Austin: University of Texas at Austin, 2008. Accessed April 18, 2026. https://farside.ph.utexas.edu/Books/Euclid/Elements.pdf
Johar, M. Syafiq. "Minimal Number of Steps in the Euclidean Algorithm and its Application to Rational Tangles." *Rose-Hulman Undergraduate Mathematics Journal* 16, no. 1 (2015): 56-72. Accessed April 18, 2026. https://scholar.rose-hulman.edu/cgi/viewcontent.cgi?article=1016&context=rhumj
Lodder, Jerry, David Pengelley, and Desh Ranjan. "Euclid’s Algorithm for the Greatest Common Divisor." *Annals of the TRIUMPHS Society* 1, no. 2 (2025). Accessed April 18, 2026. https://triumphsannals.journals.publicknowledgeproject.org/index.php/triumphsannals/article/view/16873/11865
No Discussion Added Yet
Start discussion for "Euclidean Algorithm" article
Historical and Theoretical Foundations
Mathematical Procedure and Formulation
Proof and Correctness
Computational Complexity and Lamé’s Theorem
Applications