Euclidean algorithm
Summary
The Euclidean algorithm computes the greatest common divisor of two natural numbers and . It uses two rules: , and when . It applies the second rule until the second number is . Then the first number is the result. The algorithm stops, because the second number gets smaller at each step.
Remarks
The second rule is true because and have the same common divisors as and . The number of steps is at most a constant times the number of digits of the smaller input. Lamé's theorem gives this bound. The algorithm also works in each Euclidean domain, for example in the ring of polynomials over a field.
Explanations
L1 human
To find , divide again and again, and keep the divisor and the remainder. , then , then . The last nonzero remainder is , so .
What this node needs for W2
- edge defines in: at least one definition (0 of 1)
- edge instance_of in: at least two examples (0 of 2)
- edge not_instance_of in: at least one non-example (0 of 1)
- edge specializes both: the more general notions and the special cases (0 of 1)
The writing levels say how complete the text of a node is. They do not measure its truth.
What depends on this
2 nodes use this node, directly or through other nodes.