Log in Sign up
Back to Discover
🔢

Euclidean algorithm

math Maturity 7-9

We can find a special number. It is the biggest number that fits into two other numbers. A man named Euclid found this a long time ago. It helps us work with numbers. Can you find a big number that fits into two small ones?

52 words

We can find a special number. It is the biggest number that fits into two other numbers. A man named Euclid found this a long time ago. He lived in Greece. This method is very old. It is a way to solve a puzzle.

24x60.svg
24x60.svg
You can use it to make fractions simple. It also helps keep the internet safe. It works by using smaller and smaller numbers. This keeps going until the puzzle is done. It is a very smart way to work with numbers.

93 words

Imagine you have two different lengths. You want to find the largest ruler that fits into both perfectly. This special number is called the greatest common divisor, or GCD. An ancient Greek thinker named Euclid described a way to find it. This way is called the Euclidean algorithm. It is one of the oldest sets of steps in math.

Euklid.jpg
Euklid.jpg

To use it, you look at the difference between two numbers. You replace the larger number with that difference. You keep doing this with smaller and smaller pairs. Eventually, the numbers become equal. That number is your GCD. A faster way uses remainders instead of subtraction. This is much quicker for big numbers.

Euclidean algorithm 1071 462.gif
Euclidean algorithm 1071 462.gif

This math helps in many ways. It can make fractions look simple. It also helps keep internet messages safe through cryptography. This is a way to hide secrets using math. In 1844, Gabriel Lamé proved how fast this method works. His work helped start the study of how hard math problems are to solve.

178 words

Imagine you have two different lengths and want to find the largest ruler that fits into both perfectly. This special number is called the greatest common divisor, or GCD. It is the largest number that can divide two integers without leaving any remainder. You can picture this by looking at a rectangle with different side lengths. If you can fill that entire rectangle with equal squares, the side of that square is a common divisor. The GCD is simply the largest possible square that can do this.

24x60.svg
24x60.svg

There is a clever way to find this number using a series of steps. This method is called an algorithm. One way is to take the larger number and subtract the smaller number from it. You then repeat this with the new pair of numbers. This makes the numbers get smaller and smaller each time. Eventually, the two numbers will become equal. That final number is your GCD.

A faster way to do this uses remainders instead of just subtracting. Instead of subtracting many times, you divide the larger number by the smaller one. You then take the remainder and use it with the smaller number. You keep doing this until you reach a remainder of zero. The last non-zero remainder you found is the GCD. This version is much quicker for very large numbers.

Euclidean algorithm 1071 462.gif
Euclidean algorithm 1071 462.gif

This method is named after Euclid, an ancient Greek mathematician. He first described it in his famous work called *Elements*. It is one of the oldest algorithms still used today. In 1844, a mathematician named Gabriel Lamé studied how fast this works. He proved that the number of steps is never more than five times the number of digits in the smaller number. This discovery helped start the study of how hard math problems are to solve.

Euklid.jpg
Euklid.jpg

Today, this math is used for many important jobs. It helps people simplify fractions to their simplest form. It is also used in cryptography to keep internet communications secure. Cryptography is a way of using math to protect secrets. The algorithm is also used to solve complex equations and find patterns in numbers. It even helps mathematicians prove deep rules about how numbers work.

Euclidean Algorithm Running Time.svg
Euclidean Algorithm Running Time.svg

380 words

The Euclidean algorithm is a highly efficient method for calculating the greatest common divisor (GCD) of two integers. The GCD is the largest natural number that can divide both numbers without leaving a remainder. In mathematics, this value is also called the greatest common factor (GCF) or the highest common factor (HCF). When two numbers have no common factors other than one, they are described as being coprime or relatively prime.

24x60.svg
24x60.svg

To understand how this works, imagine a large rectangle with side lengths $a$ and $b$. You can attempt to fill this entire area with identical square tiles. A common divisor is any side length of a square that can perfectly cover the rectangle without gaps or overlaps. The GCD represents the side length of the largest possible square that can tile the rectangle.

The core mechanism of the algorithm relies on a specific principle of division. This principle states that the GCD of two numbers does not change if you replace the larger number with the difference between the two. For example, the GCD of 49 and 21 is the same as the GCD of 28 and 21. By repeatedly subtracting the smaller number from the larger one, you create a sequence of smaller and smaller pairs. This process eventually results in two equal numbers, which is the GCD.

Euclidean algorithm 1071 462.gif
Euclidean algorithm 1071 462.gif

While subtraction works, a more efficient version uses the remainder from division. Instead of subtracting many times, you divide the larger number by the smaller number to find the remainder. You then replace the larger number with this remainder and repeat the process. This version is much faster because it shortcuts many subtraction steps. The algorithm terminates when the remainder reaches zero. The last non-zero remainder in the sequence is the GCD.

This efficient method was analyzed deeply by Gabriel Lamé in 1844. He proved a significant result known as Lamé's Theorem. He showed that the number of steps required is never more than five times the number of digits in the smaller integer. This proof was a landmark event because it marked the beginning of computational complexity theory. This field studies how much time or effort is needed to solve specific mathematical problems.

Euclidean Algorithm Running Time.svg
Euclidean Algorithm Running Time.svg

The algorithm is named after the ancient Greek mathematician Euclid. He first described this method in his influential work, *Elements*. It is recognized as one of the oldest algorithms still in common use today. While Euclid originally described it for natural numbers and geometric lengths, the method was generalized in the 19th century. It can now be applied to other mathematical structures, such as polynomials of one variable and Gaussian integers. These applications lead to modern concepts like Euclidean domains in abstract algebra.

Beyond simple arithmetic, the Euclidean algorithm has vital practical applications. It is used to reduce fractions to their simplest possible form. It also plays a critical role in performing division within modular arithmetic. In the modern world, these computations are essential for cryptographic protocols. These protocols secure internet communications by protecting data from unauthorized access. The algorithm is also used to solve Diophantine equations and to find accurate rational approximations for real numbers.

Diophante Bezout.svg
Diophante Bezout.svg

Finally, the algorithm serves as a fundamental tool for proving deep theorems in number theory. It is used in proofs regarding Lagrange's four-square theorem and the uniqueness of prime factorizations. By using the extended Euclidean algorithm, one can express the GCD as a linear combination of the two original numbers. This specific relationship is known as Bézout's identity. This identity shows that the GCD can be written as the sum of the two numbers, each multiplied by an integer.

SternBrocotTree.svg
SternBrocotTree.svg

618 words
🖼️ Images & Media (9)
File:Euclid's algorithm Book VII Proposition 2 3.svg
Euclid's algorithm Book VII Proposition 2 3.svg
File:24x60.svg
24x60.svg
File:Euclidean algorithm 1071 462.gif
Euclidean algorithm 1071 462.gif
File:Euklid.jpg
Euklid.jpg
File:Diophante Bezout.svg
Diophante Bezout.svg
File:SternBrocotTree.svg
SternBrocotTree.svg
File:Euclidean Algorithm Running Time.svg
Euclidean Algorithm Running Time.svg
File:Gaussian primes.svg
Gaussian primes.svg
File:Eisenstein primes.svg
Eisenstein primes.svg
Up Next
🔢
Greatest common divisor
Math
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.