Elegant Roots

If a a and b b are positive integers and a > b a > b , then what is the sum of all possible values of a a such that a + b = 2009 ? \sqrt{a} + \sqrt{b} = \sqrt{2009}?


The answer is 3157.

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.

4 solutions

Akash Shah
May 25, 2014

Writing in latex the solution of Satyen Nabar, We have 2009 = 7 41 \sqrt { 2009 } = 7\cdot \sqrt { 41 } So for a>b and both positive integers a \sqrt { a } can be 6 41 , 5 41 , 4 41 6\cdot \sqrt { 41 } , 5\cdot \sqrt { 41 }, 4\cdot \sqrt { 41 } . So sum of all possible values of a is 1476 + 1025 + 656 = 3157 1476+1025+656=3157

Can you explain why those are the only solutions? Why can't we have others?

Calvin Lin Staff - 7 years ago

Log in to reply

Well Calvin can't we have 2009,0 as the answer?I want my rating back......

Harsh Shrivastava - 6 years, 12 months ago

Log in to reply

0 is not a positive integer....!!

Manjoosh Ep - 6 years, 11 months ago

Without loss of generality, let:

a = 2009 b \sqrt{a}=\sqrt{2009}-\sqrt{b}

Squaring both sides will provide

a = 2009 + b 2 2009 b a=2009+b-2\sqrt{2009b}

Notice that 2009 = 7 2 × 41 2009=7^2 \times 41

Rewrite ad

a = 2009 + b 2 7 2 × 41 × b a=2009+b-2\sqrt{7^2 \times 41 \times b}

The L H S LHS must be positive integers and so do the R H S RHS . Thus, 7 2 × 41 × b \sqrt{7^2\times 41\times b} must be an integer. In other words, 7 2 × 41 × b 7^2 \times 41 \times b is a perfect square.

Let 7 2 × 41 × b = k 2 7^2 \times 41\times b =k^2 for any integer k k

7 2 7^2 is definitely a perfect square since the exponents is divisible by 2. 41 41 is not a perfect square.

b b may have more than one solution, or even no solutions. Since 7 2 × 41 7^2 \times 41 is not a perfect square, we have to multiply (the smallest solution) 41 41 to make it a perfect square. But, there is a case that there exist a larger solution than 41 41 . Thus, to make a guarantee of perfect square, the general solution of b b is

b = 41 × l 2 b=41\times l^2 for any l l

Now, with a little logic, we find that

2009 > b > 0 2009>b>0

Since a a will be any non-positive integers if b > = 0 b>=0

Now, rewrite as

0 < b < 2009 0<b<2009

0 < 41 l 2 < 2009 0<41l^2<2009

0 < l 2 < 49 0<l^2<49

From inequality above, the solutions of l l is 1 , 2 , 3 , 4 , 5 , 6 1, 2, 3, 4, 5, 6 and makes b b the solution 41 × 1 2 , 41 × 2 2 , 41 × 3 2 , 41 × 4 2 , 41 × 5 2 , 41 × 6 2 41 \times 1^2, 41 \times 2^2, 41 \times 3^2, 41 \times 4^2, 41 \times 5^2, 41 \times 6^2

By trial and error, we have all possible a a solution. They are 1476 , 1025 , 656 1476, 1025, 656

Finally, the sum of all possible values of a a is 1476 + 1025 + 656 = 3157 1476+1025+656=3157

Figel Ilham - 6 years, 3 months ago
Satyen Nabar
May 24, 2014

Factorise 2009 --- 7x7x41 so root of 2009 = 7* root 41

Possible values of a and b

6* root 41 + root 41

5* root 41 + 2 * root 41

4 * root 41 + 3 * root 41

Thus a =

36*41 = 1476

25*41= 1025

16*41= 656

Sum of all values of a = 3157

Great problem as always!But I recommend you to use Latex for your solutions...The first step is to wrap your math in these braces \ ( \ ) without the spaces between "\" and "(".You can find the rest of the syntax here

Eddie The Head - 7 years ago

Log in to reply

@satyen nabar I've noticed that you seem to know Latex syntax, but just need to know to add the brackets.

Calvin Lin Staff - 7 years ago

I just wrote Elegant Roots 2 , but the tag didn't work :/

Mahdi Al-kawaz - 7 years ago

Log in to reply

@ mentions currently do not work within problems / notes. They only work in the comments section.

Calvin Lin Staff - 7 years ago

Code

1
2
3
4
5
6
import math
for a in range(1,2009):
    for b in range(0,2009):
        if (math.sqrt(a)+math.sqrt(b)==math.sqrt(2009)):
            if (a>b):
                print(a,b)

Output

1
2
3
656 369
1025 164
1476 41

Sum

Sum = 656 + 1025 + 1476 = 3157 =656+1025+1476=3157

Brock Brown
Feb 20, 2015

I used a dictionary so I only had to calculate the square root 2009 times instead of four million times. The rest is brute force.

Python:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
from math import sqrt
from itertools import product
memo = {}
def root(n):
    if n in memo:
        return memo[n]
    memo[n] = sqrt(n)
    return memo[n]
total = 0
goal = root(2009)
tests = xrange(1,2010)
for a, b in product(tests,repeat=2):
    if a > b:
        if root(a) + root(b) == goal:
            total += a
print "Answer:", total

Similar solution, but smaller code!

Vinayak Srivastava - 11 months, 3 weeks ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...