Skip to content
← All questions

Where does the remainder fit in the Euclidean step for nonnegative a and positive b?

In the Euclidean step gcd⁡(a,b)=gcd⁡(b,a mod b)\gcd(a,b)=\gcd(b,a\bmod b), the remainder a mod ba\bmod b becomes the new second argument of the pair. It replaces the original dividend aa in the next iteration.

Conditions

  • aa is a nonnegative integer.
  • bb is a positive integer.
  • The operation is the Euclidean step gcd⁡(a,b)=gcd⁡(b,a mod b)\gcd(a,b)=\gcd(b,a\bmod b).

Reasoning, step by step

  1. Compute the remainder of aa divided by bb.
  2. Identify this remainder as a mod ba\bmod b.
  3. Place the remainder in the second position of the new pair (b,a mod b)(b, a\bmod b).
  4. Use this new pair for the next iteration of the algorithm.

Example

For nonnegative aa and positive bb, the Euclidean step is gcd⁡(a,b)=gcd⁡(b,a mod b)\gcd(a,b)=\gcd(b,a\bmod b). The remainder is smaller than bb, which makes repeated steps terminate.

Common misconceptions

  • Placing the remainder in the first position of the new pair.
  • Confusing the remainder with the quotient.

Watch the explanation

Connected concepts

Explore next

Related questions

Meet the concept

↗
Find a method

↗
Meet the concept

↗
Find a method

↗
Find a method

↗

Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.