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