Greedy Calvinosaurus Dinosaur

Greedy Calvinosaurus Dinosaur is threatening to gobble you up, unless you can tell him what is the largest possible value of gcd ( 122 + n 2 , 122 + ( n + 1 ) 2 ) , \gcd (122 + n^2, 122 + (n+1)^2 ) , as n n ranges over all positive integers.

Quick, to save your life, what is the answer?


The answer is 489.

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.

5 solutions

gcd ( 122 + n 2 , 122 + ( n + 1 ) 2 ) \gcd(122 + n^2,122 + (n + 1)^2)

= gcd ( 122 + n 2 , 2 n + 1 ) = \gcd(122 + n^2,2n + 1)

Since 2n + 1 is odd, multiplying 122 + n 2 122 + n^2 with 2 will not change the gcd.

= gcd ( 244 + 2 n 2 , 2 n + 1 ) = \gcd(244 + 2n^2,2n + 1)

Dividing 244 + 2 n 2 244 + 2n^2 by 2 n + 1 2n + 1

= gcd ( 244 n , 2 n + 1 ) = \gcd(244 - n,2n + 1)

Again, since 2 n + 1 2n + 1 is odd, multiplying 2n + 1 with 2 will not affect the gcd.

= gcd ( 488 2 n , 2 n + 1 ) = \gcd(488 - 2n,2n + 1)

Dividing 488 - 2n by 2n+1

= gcd ( 489 , 2 n + 1 ) = \gcd(489, 2n + 1)

Therefore largest value of gcd will be 489, when n is a multiple of 489

Moderator note:

Nice solution, with a little misprint at the very end: instead of "when n is a multiple of 489" you most probably meant "when 2n+1 is a multiple of 489".

Brilliant.

Dragan Markovic - 7 years, 8 months ago

I think in the 5th line from the bottom you meant 'multiplying 244 - n with two will not change the gcd'.

Ananay Agarwal - 7 years, 8 months ago

Awesome!!!Mind blowing

Biswadeep Sen - 7 years, 3 months ago
Russell Few
Sep 16, 2013

We let d n d_n be the greatest common divisor of 122 + n 2 122+n^2 and 122 + ( n + 1 ) 2 122+(n+1)^2 .

By Euclidean Algorithm that d n d_n is equal to ( 122 + ( n + 1 ) 2 ) ( 122 + n 2 ) = 2 n + 1 (122+(n+1)^2)-(122+n^2)=2n+1 . d n d_n is a factor of ( 2 n + 1 ) 2 = 4 n 2 + 4 n + 1 (2n+1)^2=4n^2+4n+1 . Note that it is also a factor of 4 ( 122 + n 2 ) = 488 + 4 n 2 4(122+n^2)=488+4n^2 . Hence it is a factor of their difference, which is 4 n 487 4n-487 . Also, d n d_n divides 2 ( 2 n + 1 ) = 4 n + 2 2(2n+1)=4n+2 . Since it divides 4 n 487 4n-487 and 4 n + 2 4n+2 , it must divide their difference, which is 489 489 .

Now, we would show that 489 489 is achievable.

We take n = 244 n=244 . 122 + 24 4 2 = 122 ( 1 + 2 ( 244 ) ) = 122 ( 489 ) 122+244^2=122(1+2(244))=122(489) , and 2 ( 244 ) + 1 = 489 2(244)+1=489 , which is the difference of 122 + 24 4 2 122+244^2 and 122 + 24 5 2 122+245^2 .

Hence 489 489 is achievable, and the answer is 489 \boxed{489} .

Moderator note:

Nice job!

Sunny Yoo
Sep 16, 2013

We will define [a,b] as the gcd of the numbers a,b for convenience. Using the Euclidean Algorithm, it is clear that [ 122 + n 2 , 122 + n 2 + 2 n + 1 ] = [ 122 + n 2 , 2 n + 1 ] [122+n^2, 122+n^2+2n+1]=[122+n^2, 2n+1] . However, 2 n + 1 2n+1 will never be a multiple of 4, so we can multiply the expression 122 + n 2 122+n^2 , as it won't affect the gcd. Hence, we get [ n 2 + 122 , 2 n + 1 ] = [ 4 n 2 + 488 , 2 n + 1 ] [n^2+122, 2n+1]=[4n^2+488, 2n+1] Dividing the latter expression from the first we get 2 n 1 + 489 2 n + 1 2n-1+ \frac{489}{2n+1} . This means that when subtracting (hint, hint, euclidean algorithm) the second expression from the first expression 2 n 1 2n-1 times, an integer, we have a remainder of 489. Hence this is the equivalence of euclidean algorithm, so we now have that [ 122 + n 2 , 122 + ( n + 1 ) 2 ] = [ 2 n + 1 , 489 ] [122+n^2, 122+(n+1)^2]=[2n+1, 489] . The prime factorization of 489 is 3 163 3 \cdot 163 , so if 2 n + 1 < 489 2n+1<489 either 2 n + 1 = 1 , 3 , 163 , 489 2n+1=1,3,163,489 . Of course we wish to maximize the gcd of both of these expressions/numbers, and if n = 244 n=244 , the gcd could be 489. Obviously, if 2 n + 1 > 489 2n+1>489 , then we would maximize it's gcd if the gcd was 489, and this occurs for n = 489 k + 244 n=489k+244 , for positive integers k k . Hence, our gcd is 489 \boxed{489} .

Moderator note:

Nice job!

Ankit Akash
Sep 17, 2013

We know that, ( a , b ) = ( a ± b ) (a,b) = (a\pm b)

so, ( 122 + n 2 , 122 + ( n + 1 ) ) 2 ) (122 + n^{2},122+ (n+1))^{2}) = ( 122 + n 2 , 122 + ( n + 1 ) 2 122 + n 2 ) = (122 + n^{2},122+(n+1)^{2} - 122+n^{2}) = ( 122 + n 2 , 1 + 2 n ) = (122 + n^{2},1+2n)

Note that 1+2n can never be even. so we can multiply 2 in its complementry term without affecting their GCD.

= 2 ( 122 + n 2 , 1 + 2 n ) = 2*(122 + n^{2},1+2n) = ( 122 + n 2 n ( 1 + 2 n ) , 1 + 2 n ) = (122 + n^{2} - n(1+2n),1+2n) = ( 244 n , 1 + 2 n ) = (244 -n,1+2n) = ( 2 ( 244 n ) , 1 + 2 n ) = (2*(244 -n),1+2n) = ( 488 2 n + 1 + 2 n , 1 + 2 n ) = (488-2n + 1+2n,1+2n) = ( 489 , 1 + 2 n ) = (489,1+2n)

So the req. GCD must divide 489 and 2n+1 and so higesht such GCD would be 489.

Yes, you proved that GCD cannot exceed 489. 489. To finish the problem, you must also find n n for which it is 489. 489.

Alexander Borisov - 7 years, 8 months ago

We will make use of the following known result: If a , b , q , a,b,q, and r r are integers with a = b q + r a=bq+r then gcd ( a , b ) = gcd ( b , r ) . \gcd(a,b) = \gcd(b,r).

In our problem, we have 122 + ( n + 1 ) 2 = ( 122 + n 2 ) + ( 2 n + 1 ) 122+(n+1)^2 = (122+n^2) + (2n+1) and 4 ( 122 + n 2 ) = ( 2 n 1 ) ( 2 n + 1 ) + 489. 4(122+n^2) = (2n-1)(2n+1)+489. Therefore we have gcd ( 122 + ( n + 1 ) 2 , 122 + n 2 ) = gcd ( 122 + n 2 , 2 n + 1 ) \gcd(122+(n+1)^2,122+n^2) = \gcd(122+n^2, 2n+1) and gcd ( 4 ( 122 + n 2 ) , 2 n + 1 ) = gcd ( 2 n + 1 , 489 ) . \gcd(4(122+n^2), 2n+1) = \gcd(2n+1,489). Since 2 n + 1 2n+1 is odd, it follows that gcd ( 4 ( 122 + n 2 ) , 2 n + 1 ) = gcd ( 122 + n 2 , 2 n + 1 ) . \gcd(4(122+n^2), 2n+1) = \gcd(122+n^2, 2n+1). Hence gcd ( 122 + ( n + 1 ) 2 , 122 + n 2 ) = gcd ( 2 n + 1 , 489 ) , \gcd(122+(n+1)^2,122+n^2) = \gcd(2n+1,489), the greatest value of which is 489 \boxed{489} when 2 n + 1 = 489 2n+1 = 489 or when n = 244. n=244.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...