# Number of pairs of integers satisfying this sum

1. May 10, 2017

### vishnu 73

1. The problem statement, all variables and given/known data

determine the number of pairs of integers (a,b) 1≤b<a<200 such that the sum
$(a+b) + ( a-b) + ab + \frac a b\$
is the square of an integer

i have the solution to the problem this was the given solution

the given equation is equivalent to
$\frac {a*(b+1)^2} b\\$
hence
$\frac a b = n^2\$
hence a = bn2 ≤ 200
we must have b≥ 1 and n ≥2 where b and n are integers
thus the number of pairs is given by
$floor(200/1^2) + floor (200/2^2) .... floor (200/14^2)$ = 112 pairs

this is the given solution i dont quite understand the last part are they using b = 1

i did another method but i am not sure what is wrong someone point the mistake to me thanks it is below

2. Relevant equations

3. The attempt at a solution

the equation can also be written as
$a( \sqrt b + \frac 1 {\sqrt b})^2 = k^2$
meaning that a = n2 for some integer n and
$\sqrt b + \frac 1 {\sqrt b} = l$
for some integer l defining j = l2
b2 + b (2 - j ) + 1 = 0
taking discriminant it must be more than zero hence
j≤4
hence
l ≤ ±2
only j = 4 gets a real b
hence b = 1 so i got b = 1 is the only value for b is it correct
next
we have 4a = k2
4≤ k2 ≤ 800
the number of squares between the range is definitely not 112 so what am i doing wrong?

Last edited: May 10, 2017
2. May 10, 2017

### Buffu

$a( \sqrt b + \frac 1 {\sqrt b}) \ne (a+b) + ( a-b) + ab + \frac a b$

For b = 1 and a = 4.

3. May 10, 2017

### vishnu 73

i am sorry that is not the correct equation i forgot the square i edited it now

4. May 10, 2017

### Buffu

$\Delta = (2-j)^2 - 4 = 4 + j^2 - 4j - 4 = j^2 - 4j$

But for j < 5, the opposite is true.

5. May 10, 2017

### vishnu 73

why do you have to expand it i just did

Δ = (2 - j)2 - 4≥0
2-j ≥ ±2
j cannot be zero
j = 1,2 of which only j = 2 gives a real b
then b = 1
edit:
my method is wrong sorry about that
so using your method
j<0 or j>4
so b≥1
then how do i do we have a = n2

oh wait my method is completely off and only just proved the already given statement that b>0
so my method has been completely wrong

i understand the given solution to the end but what are they doing with the floor function

Last edited: May 10, 2017
6. May 10, 2017

### Buffu

I don't think
$\displaystyle \lfloor 200/1^2 \rfloor + \lfloor 200/2^2\rfloor+ ...+ \lfloor 200/14^2\rfloor$

equals 112 as $\lfloor 200/1^2 \rfloor$ is 200. I think the given expression is 312.

Edit:-

I see what they did now,

$\displaystyle \lfloor 200/1^2 \rfloor + \lfloor 200/2^2\rfloor+ ...+ \lfloor 200/14^2\rfloor = 312$

but since $a \ne b$, so they subtracted 200 from it.

7. May 10, 2017

### vishnu 73

no i am sorry once again ignore the first term only starts from 22
what exactly are they doing

are they just finding all the possible value of b by using floor(200/n2) where n goes from 2 to 14
but the condition is only that bn2 ≤ 200
then couldn't we also use floor(199/n2) why 200

8. May 10, 2017

### Buffu

You know $a = bn^2$, so you need all $b$ that multiplied by some $n^2$ give some $a$ less than $200$.

Here $n^2$ is constant.

Lets say $mk = z$ where k is some real number, then you know that $mj = i < z$ if $j < k$.
Now if you want to find all $(i,j)$ such that $i/j = m$ then you just need to count the number of $j$ which is all +ve integers less than $k$.

If we have $g(m)$ which gives the number of $(i,j)$ for a $m$. Then we will define $g$ by $\displaystyle g(m) = \begin{cases} \operatorname{floor}(z/m)\qquad \text{if z is not divisible by m} \\ z/m - 1\qquad \text{else} \end{cases}$.

If you take $m = n^2$ from $2$ to $14$, $j = b$, $a= i$ and $z= 200$ and apply the above logic you will get your answer.

On a side note, If I understand correctly then the given answer is a bit wrong since for $n = 2$, floor(200/4) = 50, but for $b = 50$, $a= 200$ which is not possible, so $49$ is correct number of pairs for $n = 2$ not $50$.

Last edited: May 10, 2017
9. May 10, 2017

### Buffu

The condition is $bn^2 < 200$ not $bn^2 \le 200$, since $a< 200$ not $a \le 200$.

Look at the first sentence of your question.

10. May 10, 2017

### vishnu 73

ya i agree there is something wrong with the solution you are right but now i am still trying to understand your solution now thanks for it

11. May 10, 2017

### Buffu

If you don't understand then you can ask me.

12. May 10, 2017

### vishnu 73

ya so this is my question thanks for being patient with me really appreciate it
so for n = 3 we had
floor(200/9) giving b =22 but why couldn't b have been 21
because 21 * 9 = 189 = a < 200 why not
?????
it is the inequality that is giving me all the trouble

13. May 10, 2017

### Staff: Mentor

Neither of these is an equation (no = sign) -- they are expressions. If two expressions have the same value, they are equal, not equivalent.

14. May 10, 2017

### Buffu

Yes it can be. It can be $20, 19 ,...$.

I never said $b$ can be less than the "floor value" rather than it can be all values less than the "floor value". We are not interested in the value rather than the number of values for $b$. The number of b's is equal to "floor value" if $200/n^2$ is not a whole number.

Last edited: May 10, 2017
15. May 10, 2017

### vishnu 73

omg it all makes sense now when you said the floor gives the number of b rather than b itself thanks a lot couldn't express how much it helped thanks once again a lot good luck with your career !!!!!

16. May 10, 2017

### Ray Vickson

Using $b = a/n^2$ we have
$$(a+b) + ( a-b) + ab + \frac{a}{b} = \left(n + \frac{a}{n} \right)^2,$$
so $n + a/n$ must be an integer. Thus, $a$ must be a multiple of $n$. We can easily enough enumerate and count the possibilities for $n=1$, $n=2$, $n=3, \ldots , n = 199$.