The GCD of given numbers is 3.
Step 1 :
Divide $ 654321 $ by $ 123456 $ and get the remainder
The remainder is positive ($ 37041 > 0 $), so we will continue with division.
Step 2 :
Divide $ 123456 $ by $ \color{blue}{ 37041 } $ and get the remainder
The remainder is still positive ($ 12333 > 0 $), so we will continue with division.
Step 3 :
Divide $ 37041 $ by $ \color{blue}{ 12333 } $ and get the remainder
The remainder is still positive ($ 42 > 0 $), so we will continue with division.
Step 4 :
Divide $ 12333 $ by $ \color{blue}{ 42 } $ and get the remainder
The remainder is still positive ($ 27 > 0 $), so we will continue with division.
Step 5 :
Divide $ 42 $ by $ \color{blue}{ 27 } $ and get the remainder
The remainder is still positive ($ 15 > 0 $), so we will continue with division.
Step 6 :
Divide $ 27 $ by $ \color{blue}{ 15 } $ and get the remainder
The remainder is still positive ($ 12 > 0 $), so we will continue with division.
Step 7 :
Divide $ 15 $ by $ \color{blue}{ 12 } $ and get the remainder
The remainder is still positive ($ 3 > 0 $), so we will continue with division.
Step 8 :
Divide $ 12 $ by $ \color{blue}{ 3 } $ and get the remainder
The remainder is zero => GCD is the last divisor $ \color{blue}{ \boxed { 3 }} $.
We can summarize an algorithm into a following table.
| 654321 | : | 123456 | = | 5 | remainder ( 37041 ) | ||||||||||||||
| 123456 | : | 37041 | = | 3 | remainder ( 12333 ) | ||||||||||||||
| 37041 | : | 12333 | = | 3 | remainder ( 42 ) | ||||||||||||||
| 12333 | : | 42 | = | 293 | remainder ( 27 ) | ||||||||||||||
| 42 | : | 27 | = | 1 | remainder ( 15 ) | ||||||||||||||
| 27 | : | 15 | = | 1 | remainder ( 12 ) | ||||||||||||||
| 15 | : | 12 | = | 1 | remainder ( 3 ) | ||||||||||||||
| 12 | : | 3 | = | 4 | remainder ( 0 ) | ||||||||||||||
| GCD = 3 | |||||||||||||||||||
This solution can be visualized using a Venn diagram.
The GCD equals the product of the numbers at the intersection.