# Diophantine equation

## Recommended Posts

Hello everyone,

Im new in this forum and in advance I would like to apologise for possibly posting this thread in a wrong place.

I am learning mathematics and I came across this problem that I can't find a solution for:

x^2 - 4^2 = 1000000 , find all possible integer solutions for x and y.

Being an amateur mathematician I tried to understand this problem using system of equations technique and instead of million i used a prime number (5) as an anwser and turned this equation into difference of squares:

(x+2y)(x-2y) = 5;

5 is prime, has two divisors -> 5, 1;

(x+2y) = 5

(x-2y) = 1

2y - 2y = 0 (y is out)

2x = 6

x = 3;

3+2y = 5

2y = 2

y = 1;

Anwser : x = 3, y = 1;

I tried to do similar thing with a million:

(x+2y)(x-2y) = 1000000

let's say (x+2y) = 1000 and (x-2y) = 1000

(x+2y)= 1000

(x-2y) = 1000

2x = 2000

x=1000

y = 0;

But how do you find other solutions to this equation ?

I found these anwsers using brute force algorithm in java:

[[31258, 15621], [12520, 6240], [6290, 3105], [2600, 1200], [1450, 525], [1000, 0]]

is there a formula for finding all of the Integer possibilities? Where should I look ?

Thank you

##### Share on other sites

I don't know why you are using "brute force" as you call it when you already had the solution staring at you!

You have "either x+ 2y= 5 or x- 2y= 1".

If x+ 2y= 5 then, for every y, x= 5- 2y.  Solutions, in (x, y) form, are (5, 0). (3, 1), (1, 2). (-1. 3), ..., (5- 2y, y) for y non-negative and (7. -1), (9. -2). (11, -3),... for y negative.

If x- 2y= 1 then, for every y, x= 2y+ 1.  Solutions are (1, 0), (3, 1). (5, 2), (7, 3), ... for y non-negative and (-1, -1), (-3, -2), (-5, -3), ... for y negative.

Those at are the solutions: $\{(5- 2y, y)\}\cup\{(2y+1, y)\}$  for y any  integer.

Edited by HallsofIvy