Largest greatest common divisor

Find the largest possible value of the greatest common divisor of the numbers 5 n + 6 5n+6 and 8 n + 7 8n+7 , where n n is an arbitrary positive integer.


The answer is 13.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

15 solutions

Brent Jensen
Nov 17, 2013

This question asks what is the largest X such that:

8 n + 7 0 ( m o d x ) 5 n + 6 0 ( m o d x ) 8n + 7 \equiv 0 \pmod {x} \\ 5n + 6 \equiv 0 \pmod{x}

Applying modular arithmetic , we get that

0 ( 8 n + 7 ) + ( 5 n + 6 ) = 13 n + 13 = 13 ( n + 1 ) ( m o d x ) 0 \equiv ( 8n + 7 ) + ( 5n + 6 ) = 13 n + 13 = 13 (n+1 ) \pmod{x}

Since we know that gcd ( n + 1 , 5 n + 6 ) = gcd ( n + 1 , 1 ) \gcd( n+ 1, 5n+6 ) = \gcd ( n+1, 1 ) , hence the largest GCD that is possible is 13.

This occurs when n = 4 n = 4 , which gives us 5 n + 6 = 26 5n + 6 = 26 and 8 n + 7 = 39 8n + 7 = 39 .

Really crisp and elegant solution. Thanks.

Kunal Suri - 7 years, 6 months ago

Great approach Brent...

Anup Palz - 7 years, 6 months ago

Truely brilliant approach

Chandrachur Banerjee - 7 years, 6 months ago

For the \equiv sign, you could type \equiv. Good solution, I say.

Vincent Tandya - 7 years, 6 months ago

wow nice

Pranav Vashistha - 7 years, 6 months ago

Thumbs up dude!

Ali Hussain - 7 years, 6 months ago

But if you plug in an integer into 8n+7 and 5n+6, neither actually gives you a number divisible by 13. What am I missing?

Imran Saleh - 7 years, 6 months ago

Log in to reply

The problem asks for the maximum possible value of the GCD; that is, that value may not be achieved for all n , n, but there is some value of n n for which it is achieved. (In this problem, n = 4 n = 4 is a possible value for which gcd ( 8 n + 7 , 5 n + 6 ) = 13. \gcd(8n+7, 5n+6) = 13. )

Michael Tang - 7 years, 6 months ago

>>in the 2nd last line i understand how two gcd's are equal but i can't understand how this proves that 13 is the maximum possible ?

Syed Hissaan - 4 years ago

the answer may mean that if x divides 13(n+1), and then x divides 13 or (n+1). if x divides (n+1), then gcd(8n+7,5n+6) = gcd(n+1,5n+6) = gcd(n+1,1), which means 1.since 13>1,so that is all.

Steve Tan - 2 years, 11 months ago

Great solution Uncle Brent.I am completely grounded. T h a n k s Thanks

Soham Dibyachintan - 7 years, 5 months ago
Daniel Chiu
Nov 17, 2013

Using the Euclidean Algorithm, gcd ( 5 n + 6 , 8 n + 7 ) = gcd ( 5 n + 6 , 3 n + 1 ) = gcd ( 2 n + 5 , 3 n + 1 ) = gcd ( 2 n + 5 , n 4 ) = gcd ( n + 9 , n 4 ) = gcd ( 13 , n 4 ) \begin{aligned} \gcd(5n+6,8n+7)&=\gcd(5n+6,3n+1) \\ &=\gcd(2n+5,3n+1) \\ &=\gcd(2n+5,n-4) \\ &=\gcd(n+9,n-4) \\ &=\gcd(13,n-4) \end{aligned} Therefore, the greatest common divisor must be a factor of 13, the largest of which is 13 \boxed{13} . The maximum is achieved, for example, when n = 17 n=17 , as gcd ( 13 , 26 ) = 13 \gcd(13,26)=13 .

cool1

Jian Wang - 7 years, 6 months ago

yeah, first time have seen this..thnx :)

Ratul Das - 7 years, 6 months ago

Dint knew this algorithm thankz

Chandrachur Banerjee - 7 years, 6 months ago

Log in to reply

You can learn about the Euclidean Algorithm in the Techniques Trainer .

Calvin Lin Staff - 7 years, 6 months ago

I also solved the problem in the same way.Nice approach!

Akash Hossain - 3 years, 2 months ago

Nice approach... I would just add to it the fact that 'the maximum' can also be achieved when n=4(as worked out in other solutions), as the GCD of 13 and 0 is equal to 13.

Hrithik Thakur - 1 year, 6 months ago

This can also be done as:

Let the gcd be x.

5 n 6 0 m o d x 5n - 6 \equiv 0 \mod x

5 n 6 m o d x \implies 5n \equiv 6 \mod x

40 n 48 m o d x \implies 40n \equiv 48 \mod x

8 n 7 0 m o d x 8n - 7 \equiv 0 \mod x

8 n 7 m o d x \implies 8n \equiv 7 \mod x

40 n 35 m o d x \implies 40n \equiv 35 \mod x

So, 48 35 m o d x 48 \equiv 35 \mod x

Now, 48 13 = 35 48 - 13 = 35

x = 13 \therefore x = 13

Shubhrajit Sadhukhan - 11 months, 2 weeks ago
Parth Chopra
Nov 18, 2013

This question is a direct application of the Euclidean Algorithm. We can continue to simplify the equation which expresses the G C D GCD of the 2 binomials until we get something we can work with.

8 n + 7 = 1 × ( 5 n + 6 ) + ( 3 n + 1 ) 8n + 7 = 1 \times (5n + 6) + (3n +1)

5 n + 6 = 1 × ( 3 n + 1 ) + ( 2 n + 5 ) 5n + 6 = 1 \times (3n + 1) + (2n + 5)

3 n + 1 = 1 × ( 2 n + 5 ) + ( n 4 ) 3n + 1 = 1 \times (2n + 5) + (n - 4)

2 n + 5 = 2 × ( n 4 ) + ( 13 ) 2n + 5 = 2 \times (n - 4) + (13)

Now that we have simplified the expression for the GCD of the two binomials, we can rewrite it.

G C D ( 8 n + 7 , 5 n + 6 ) = G C D ( n 4 , 13 ) GCD(8n + 7, 5n + 6) = GCD(n - 4, 13)

We want to find the maximum value for n n such that n 4 n - 4 shares a common factor with 13 13 .

The maximum possible value for n n can be found this way by setting n 4 n - 4 equal to 13 13 .

Therefore, n = 17 n = 17 and the greatest possible value for the GCD is 13 \boxed{13} .

Given that the number x we are searching for is a G.C.D., it divides 5n+6 and 8n+7. This mathematically speaking means that there are two, possibly, different numbers m and L such that mx = 5n + 6 and Lx = 8n +7. Solve for n in each equation and compare both values: n=(mx-6)/5=(Lx-7)/8. From here, by solving for x we get to the equation x(8y-5z)=13. This is telling us that whatever number x is, it must divide 13 also. Due to the fact that the other factor must be positive given that x is positive and that 13 is only divisible by the positive integers 13 and 1. It must be then that the x is the greatest of the two. Hence x is 13.

Jq Chong
Nov 17, 2013

By using Euclidean algorithm, we get

g c d ( 5 n + 6 , 8 n + 7 ) gcd(5n+6 , 8n+7)

= = g c d ( 5 n + 6 , 3 n + 1 ) gcd(5n+6 , 3n+1)

= = g c d ( 2 n + 5 , 3 n + 1 ) gcd(2n+5 , 3n+1)

= = g c d ( 2 n + 5 , n 4 ) gcd(2n+5 , n-4)

= = g c d ( n + 9 , n 4 ) gcd(n+9 , n-4)

= = g c d ( 13 , n 4 ) gcd(13 , n-4)

From here, we can say that 13 n 4 13|n-4 , or else the gcd would be 1 1 .Therefore the largest possible value is 13 \boxed {13}

Abrar Nihar
Nov 17, 2013

Applying the Euclidean Algorithm again and again, we can reach our desired answer... ( a , b ) (a,b) means the greatest common divisor of a a and b b ...

( 8 n + 7 , 5 n + 6 ) (8n+7, ~5n+6)

= ( 5 n + 6 , 3 n + 1 ) = (5n+6, ~3n+1)

= ( 3 n + 1 , 2 n + 5 ) = (3n+1, ~2n+5)

= ( 2 n + 5 , n 4 ) = (2n+5, ~n-4)

= ( n 4 , 13 ) = (n-4, ~13)

Hence, the largest possible value is 13 \fbox{13} ...

Remark: The largest value is attained for any multiple of 13 13 and so n 4 = 13 m n-4=13m for some integer m m ...

awesome!!

Ali Hussain - 7 years, 6 months ago

Let, d = gcd ( 5 n + 6 , 8 n + 7 ) = gcd ( 5 m + 1 , 8 m 1 ) d=\gcd(5n+6,8n+7)=\gcd(5m+1,8m-1) where m = n + 1 m=n+1 . Now, we observe that 8 ( 5 m + 1 ) 5 ( 8 m 1 ) = 13 d 13 d = 1 or, 13 8(5m+1)-5(8m-1)=13\Rightarrow d|13\Rightarrow d=1 \ \mbox{or,} \ 13 . A simple check now reveals that for m = 5 , d = 13 m=5,\ d=13 . So 13 \boxed{13} is the answer.

Eric Zhang
Nov 18, 2013

We use Euler's algorithim for calculating GCD's. gcd ( 5 n + 6 , 8 n + 7 ) \gcd (5n+6, 8n+7) = gcd ( 5 n + 6 , 3 n + 1 ) = \gcd (5n+6, 3n+1) = gcd ( 2 n + 5 , 3 n + 1 ) = \gcd (2n+5, 3n+1) = gcd ( 2 n + 5 , n 4 ) = \gcd (2n+5, n-4) = gcd ( n + 9 , n 4 ) = \gcd (n+9, n-4) = gcd ( 13 , n 4 ) = \gcd (13, n-4) Since the GCD cannot be greater than the absolute value of any of the integers themselves, we know that the GCD cannot be greater than 13 13 .

A quick test reveals that a GCD of 13 13 is indeed possible with n = 4 n = 4 , so the answer is thus 13 \boxed{13} .

Is Euclid's algo also called Euler's?

Star Light - 7 years, 6 months ago

Log in to reply

No; that was a typo.

Eric Zhang - 7 years, 6 months ago
Christopher Boo
Nov 18, 2013

I solved this problem by Euclidean Algorithm.

By Euclidean Algorithm to calculate g c d ( 8 n + 7 , 5 n + 6 ) gcd(8n+7,5n+6) ,

8 n + 7 = ( 5 n + 6 ) + ( 3 n + 1 ) 8n+7=(5n+6)+(3n+1)

5 n + 6 = ( 3 n + 1 ) + ( 2 n + 5 ) 5n+6=(3n+1)+(2n+5)

3 n + 1 = ( 2 n + 5 ) + ( n 4 ) 3n+1=(2n+5)+(n-4)

2 n + 5 = 2 ( n 4 ) + 13 2n+5=2(n-4)+13

Interestingly, we get a beautiful number 13 13 which is the answer we want!

Minh Tâm
Dec 25, 2020
  • Let d = gcd(5n + 6, 8n + 7) then d = gcd(40n + 48, 40n + 35) = gcd (13, 40n + 35) = 13 since 13 is a prime number

Note that instead of g c d ( 13 , 40 n + 35 ) = 13 gcd(13,40n+35) = 13 , what we have is actually 13 gcd ( 13 , 40 n + 35 ) 13 \mid \gcd(13, 40n+35) .
For example, the GCD could have been 1 (E.g when 13 40 n + 35 13 \nmid 40n + 35 .

Calvin Lin Staff - 5 months, 2 weeks ago

Let the g.c.d. be x x .

5 n 6 0 m o d x 5n - 6 \equiv 0 \mod x

5 n 6 m o d x \implies 5n \equiv 6 \mod x

40 n 48 m o d x \implies 40n \equiv 48 \mod x

8 n 7 0 m o d x 8n - 7 \equiv 0 \mod x

8 n 7 m o d x \implies 8n \equiv 7 \mod x

40 n 35 m o d x \implies 40n \equiv 35 \mod x

So, 48 35 m o d x 48 \equiv 35 \mod x

Now, 48 13 = 35 48 - 13 = 35

x = 13 \therefore x = \boxed{13}

If d is a common divisor of 8n+7 and 5n+6. Then It is a divisor of 8(5n+6) - 5(8n+7) = 13. Therefore, d=1$ or d=13. We are looking the largest value so d=13.

A really simple solution! Let e be the gcd of the two numbers. Since e divides both numbers, we have: 5n + 6 = e k, 8n + 7 = e m, (k and m are some integers) Multiply 1st equation by 8, 2nd by 5 and subtract 2nd from 1st. Thus, we have: 13 = e*(8k - 5m), e = 13 / (8k - 5m) The gcd e takes the largest value when the denominator is minimal. Obviously, it can't be 0, negative or fractional, then is is 1, so the largest gcd is 13 (answer).

Nicely done :)

Calvin Lin Staff - 5 years, 6 months ago
Kushal Bose
Oct 29, 2015

follow euclid algorithm

Keshav Gupta
Nov 19, 2013

The GCD of (5n + 6) and (8n + 7) can be found out by Euclids' Division Algorithm. 8n + 7 = 1 x (5n + 6) + 3n + 1

5n + 6 = 1 x (3n + 1) + 2n + 5

3n + 1 = 1 x (2n + 5) + n - 4

2n + 5 = 2 x (n - 4) + 13

As furhter division is not possible, we can say that 13 is the GCD.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...