On the Subject of Coprime Checker
Check the pairs!
There will be two numbers on the display. Press the button labelled "Coprime" if the two numbers are coprime to each other, and press the button labelled "Not Coprime" otherwise.
Do this three times to disarm the module. An incorrect press will incur a strike and generate new numbers.
Two numbers are coprime if they share no common factors besides 1. This can be done by manually factoring each number and checking if any are shared, but there is an easier method.
- To determine if the numbers are coprime, take the larger number, and subtract the smaller number from it until it is less than the smaller number.
- Repeat this step using the new larger and smaller numbers until the smaller number is equal to 0. At this point, the remaining number is the greatest common divisor of the two numbers.
- If this number is equal to 1, the numbers are coprime. Otherwise, they are not coprime.