Quick check to find the greatest common divisor

196 Views Asked by At

To find the greatest common divisor we use the prime numbers, my question is, once we have reached a prime number greater than the largest number of the set of numbers of which we want to obtain the greatest common divisor and previously we have not found any common divisor, can we be sure that the greatest common divisor is 1? In that case, what is the proof of that property? Example: Obtain the greatest common factor of (25, 27 and 28) The first 10 prime numbers are: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29 Since we arrive at the number 29, which is greater than the largest number in the set of numbers of which we want to obtain the greatest common divisor (25, 27 and 28), without finding any common divisors, we can conclude that the greatest common divisor of (25, 27 and 28) is equal to 1 Thanks for reading, greetings from Mexico.

1

There are 1 best solutions below

1
On

Yes and in fact you can get something a bit better.

If we have $n$ numbers $a_1,\dots, a_n$ with greatest common factor $m$ with $m>1$ then there must be a prime $p$ that that divides $m$. This prime factor is less than or equal to $m$ and also less than or equal to each $a_i$.

So you only need to check the primes up to the smallest of the $a_i$.

Thanks for reading, greetings from Mexico.