This article was accepted into the corpus but its outbound wikilinks were never NER-processed — typical at the deepest BFS hop or when the run's entity cap was reached. No expansion funnel to show.
| Euclidean algorithm (number theory) | |
|---|---|
![]() | |
| Name | Euclidean algorithm |
| Nationality | Ancient Greek |
| Known for | algorithm for greatest common divisor |
Euclidean algorithm (number theory) is a classical algorithm for computing the greatest common divisor of two integers and for solving related linear Diophantine problems; it appears in ancient texts and underpins many modern theories and applications. The method iteratively reduces a pair of integers via division with remainder until a remainder of zero is reached, yielding the greatest common divisor as the last nonzero remainder. Its influence spans from classical mathematics through cryptography and computational algebra, connecting to the works of major figures and institutions in the history of mathematics.
The algorithm was described in Euclid's Elements, a foundational work by the Hellenistic mathematician Euclid associated with the Library of Alexandria and the city of Alexandria itself; Euclid's presentation influenced later authors such as Diophantus and medieval scholars in Baghdad and Cordoba. During the Islamic Golden Age, mathematicians in Baghdad and at the House of Wisdom preserved and commented on Hellenistic texts, while scholars in Al-Andalus transmitted these ideas to the Latin West through centers like Salamanca and translators in Toledo. The algorithm was studied by Renaissance figures in Florence and later by Enlightenment mathematicians in Paris, with formal analysis appearing in the 19th century through the work of scholars associated with institutions like the École Polytechnique and the University of Berlin. In the 20th century, the algorithm's role in number theory was emphasized by researchers at Princeton University, Cambridge University, and the University of Göttingen, influencing developments in computational number theory and cryptographic protocols linked to institutions such as Bell Labs and MIT.
Given two nonnegative integers a and b with a ≥ b > 0, the algorithm repeatedly replaces the pair (a, b) by (b, a mod b) until b = 0; the value a is then the greatest common divisor. The procedure as taught in many courses derives from the presentation in Euclid's Elements and is implemented in modern computing environments used at institutions like Carnegie Mellon University and Stanford University. Pseudocode (iterative form): set while b ≠ 0 do r ← a mod b; a ← b; b ← r; end while; return a. Recursive pseudocode: function gcd(a,b): if b = 0 then return a else return gcd(b, a mod b) end if. Variants used in software libraries developed at organizations such as GNU Project or Microsoft Research may include binary versions replacing division with shifts.
Correctness rests on the invariant that gcd(a,b) = gcd(b, a mod b), an identity implicitly used by Euclid and later formalized in algebraic treatments at universities like Harvard University and Yale University. Proofs typically use properties of divisibility first systematized by early modern mathematicians in Oxford and developed further in texts from Princeton University and Cambridge University. Complexity analysis shows the algorithm runs in time polynomial in the number of digits of the input; classical analysis by Lamé connected the worst-case number of division steps to Fibonacci numbers, a sequence studied since antiquity in regions such as Pisa and by scholars including Fibonacci himself. Modern computational complexity assessments, advanced at research centers like Bell Labs and IBM Research, measure bit-complexity and lead to bounds using techniques from algorithmic number theory developed at ETH Zurich and École Normale Supérieure.
Several variants adapt the basic method: the binary gcd algorithm (Stein's algorithm) replaces division by subtraction and binary shifts and is used in low-level code in projects at Microsoft Research and Intel; Lehmer's algorithm reduces multi-precision division overhead and was proposed in the context of computing with large integers at facilities like Los Alamos National Laboratory; subquadratic algorithms use fast multiplication (Karatsuba, Schönhage–Strassen) studied at MIT and University of Manchester to achieve improved asymptotic complexity. Extensions generalize from integers to polynomial rings, where the Euclidean algorithm for polynomials underpins work in algebraic geometry by scholars at IHES and University of Paris, and to Euclidean domains as formalized in algebraic texts from Princeton University and Cambridge University. Modular and p-adic adaptations appear in computational algebra systems developed at institutions such as SageMath and projects affiliated with Cornell University.
The algorithm is fundamental in modern cryptography, used in key generation and inversion steps for protocols like RSA studied at MIT, Stanford University, and Bell Labs; it is essential in coding theory applied in research at AT&T and Nokia Bell Labs and in computational algebra systems used by mathematicians at Wolfram Research and SageMath. It appears in algorithms for continued fractions connected to work by Euler and Gauss and in computational tasks in algebraic number theory pursued at University of Cambridge and University of Bonn. Practical applications include rational reconstruction and simplification of fractions in software from GNU Project and Apple, algorithmic solutions in computer algebra packages used at Max Planck Institute for Mathematics and engineering computations in industry labs like Siemens and Boeing.
Example: compute gcd(119, 544). Iteration 1: 544 = 4·119 + 68, so replace (544,119) with (119,68). Iteration 2: 119 = 1·68 + 51 → (68,51). Iteration 3: 68 = 1·51 + 17 → (51,17). Iteration 4: 51 = 3·17 + 0 → gcd = 17. This hand computation reflects exercises found in textbooks from Princeton University Press and lecture notes from MIT OpenCourseWare; similar examples illustrate the connection to continued fractions studied by Legendre and Lagrange. For polynomials over a field, the same remainder process computes greatest common divisors used in symbolic computation systems from organizations like Wolfram Research and projects at INRIA.