The GCD of given numbers is 3.
Step 1 :
Divide $ 500000001 $ by $ 5000001 $ and get the remainder
The remainder is positive ($ 4999902 > 0 $), so we will continue with division.
Step 2 :
Divide $ 5000001 $ by $ \color{blue}{ 4999902 } $ and get the remainder
The remainder is still positive ($ 99 > 0 $), so we will continue with division.
Step 3 :
Divide $ 4999902 $ by $ \color{blue}{ 99 } $ and get the remainder
The remainder is still positive ($ 6 > 0 $), so we will continue with division.
Step 4 :
Divide $ 99 $ by $ \color{blue}{ 6 } $ and get the remainder
The remainder is still positive ($ 3 > 0 $), so we will continue with division.
Step 5 :
Divide $ 6 $ 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.
| 500000001 | : | 5000001 | = | 99 | remainder ( 4999902 ) | ||||||||
| 5000001 | : | 4999902 | = | 1 | remainder ( 99 ) | ||||||||
| 4999902 | : | 99 | = | 50504 | remainder ( 6 ) | ||||||||
| 99 | : | 6 | = | 16 | remainder ( 3 ) | ||||||||
| 6 | : | 3 | = | 2 | remainder ( 0 ) | ||||||||
| GCD = 3 | |||||||||||||
This solution can be visualized using a Venn diagram.
The GCD equals the product of the numbers at the intersection.