# Thread: pairs of positive integers which solve equation

1. ## pairs of positive integers which solve equation

Find all pairs of integers x and y such that x^2-y^2=104

2. Originally Posted by Rimas
Find all pairs of integers x and y such that x^2-y^2=104
No doubt that ThePerfectHacker will want to weigh in on this, but a possible starting point (on a fairly long road!) would be to factor the LHS:
(x + y)(x - y) = 104

Now factor 104:
1, 104
2, 52
4, 26
-1, -104
-2, -52
-4, 26
are all the possibilities.

Now you have to solve simultaneous equations:
x + y = 1
x - y = 104

The solution to this is x = 105/2 and y = -103/2, which aren't integers so this doesn't work. So move on to the next possibility. etc.

I note that there are solutions for all pairs of factors where both factors are even.

-Dan

3. Originally Posted by topsquark
No doubt that ThePerfectHacker will want to weigh in on this, but a possible starting point (on a fairly long road!) would be to factor the LHS:
(x + y)(x - y) = 104
That is a perfectly acceptable solution.

4. how did you get the last part

5. Originally Posted by topsquark
No doubt that ThePerfectHacker will want to weigh in on this, but a possible starting point (on a fairly long road!) would be to factor the LHS:
(x + y)(x - y) = 104

Now factor 104:
1, 104
2, 52
4, 26
-1, -104
-2, -52
-4, 26
are all the possibilities.

Now you have to solve simultaneous equations:
x + y = 1
x - y = 104

The solution to this is x = 105/2 and y = -103/2, which aren't integers so this doesn't work. So move on to the next possibility. etc.

I note that there are solutions for all pairs of factors where both factors are even.

-Dan
Originally Posted by Rimas
how did you get the last part
You mean the part about both factors being even? Let's solve the system of equations for a general set of factors:
x + y = a
x - y = b
where a*b = 104

Solve the top equation for y:
y = a - x

Then insert this value of y into the bottom equation:
x - (a - x) = b

2x - a = b

x = (b + a)/2

y = a - x = a - (a + b)/2 = (b - a)/2

In order for x and y to be integers we need a + b and a - b to be even. Thus a and b must either both be odd or must both be even. Since a*b = 104 (an even number) at least one of a and b must be even.

Thus both a and b must be even numbers for x and y to be integers.

-Dan