Given two or more positive integers, the greatest common divisor (gcd), or highest common factor (hcf), is the largest positive integer that divides the numbers without a remainder.
If we are given the prime factorization of the numbers, finding the greatest common divisor is straightforward. Let A=p1q1p2q2…pnqn and B=p1r1p2r2…pnrn, where pi are positive prime integers and qi≥1. Then
gcd(A,B)=p1min(q1,r1)p2min(q2,r2)…pnmin(qn,rn).
However, in general, factorizing numbers is a very difficult problem, so instead we use the Euclidean Algorithm.
Technique
To find the greatest common divisor using the Euclidean Algorithm, we perform long division several times. Starting with a pair of numbers (A,B), we obtain A=Q×B+R, where Q is the quotient and 0≤R<B is the remainder. We then repeat the sequence with the pair (B,R).
As a concrete example, the following is the Euclidean Algorithm performed to calculate gcd(16457,1638):
164571638772114=====1638×1077×2121×314×17×2+++++77211470
The process stops since we reached 0, and we obtain
7=gcd(7,14)=gcd(14,21)=gcd(21,77)=gcd(77,1638)=gcd(1638,16457).
Worked Examples
1. Show that if gcd(A,N)=1, then gcd(A,B)=gcd(A,BN).
Solution: Let P be the set of primes that divide either A or B. Let P′ be the set of primes that divide either A, B or N. Let ri′ be the exponent of pi′ in the term BN. If pi′∣A, then pi∣N, hence ri′=ri, so min(qi,ri′)=min(qi,ri). If pi′∣A, then qi=0, so min(qi,ri)=0=min(qi,ri′). Hence, gcd(A,B)=gcd(A,BN).
2. (IMO '59) Prove that 14n+321n+4 is irreducible for every natural number n.
Solution: 14n+321n+4 is irreducible if and only if the numerator and denominator have no common factor, i.e. their greatest common divisor is 1. Applying the Euclidean Algorithm,
21n+414n+37n+1===1×(14n+3)2×(7n+1)(7n+1)×1+++7n+110.
Hence, gcd(21n+4,14n+3)=1, which shows that the fraction is irreducible.
#NumberTheory
#EuclideanAlgorithm
#KeyTechniques
#Olympiad
Easy Math Editor
This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
When posting on Brilliant:
*italics*
or_italics_
**bold**
or__bold__
paragraph 1
paragraph 2
[example link](https://brilliant.org)
> This is a quote
\(
...\)
or\[
...\]
to ensure proper formatting.2 \times 3
2^{34}
a_{i-1}
\frac{2}{3}
\sqrt{2}
\sum_{i=1}^3
\sin \theta
\boxed{123}
Comments
thanks ! a lot for posting such notes post some more on different topics