Integer solutions to $ x^2-y^2=33$ I'm currently trying to solve a programming question that requires me to calculate all the integer solutions of the following equation:

$x^2-y^2 = 33$

I've been looking for a solution on the internet already but I couldn't find anything for this kind of equation. Is there any way to calculate and list the integer solutions to this equation?

Thanks in advance!
Suppose that $x=y+n$; then $x^2-y^2=y^2+2ny+n^2-y^2=2ny+n^2=n(2y+n)$. Thus, $n$ and $2y+n$ must be complementary factors of $33$: $1$ and $33$, or $3$ and $11$. The first pair gives you $2y+1=33$, so $y=16$ and $x=y+1=17$. The second gives you $2y+3=11$, so $y=4$ and $x=y+3=7$. As a check, $17^2-16^2=289-256=33=49-16=7^2-4^2$.

If you want negative integer solutions as well, you have also the pairs $-1$ and $-33$, and $-3$ and $-11$.
This is all fine, but you all take the initial knowledge of the prime composition of 33 as 11*3, but imagine you did not know that. You would not know it without a lot/ some trial and error , if I instead of 33 took 1771 instead and stated x^2-y^2=1771, then only the few, would know the prime factors of 1771

There are no known ways of solving this problem other than trial and error. Likewise with 33, if you had no knowledge that 11*3= 33

You will have to run through this calculation:  sqrt(1771)=42.08 and mod(1171,4)=3
Mod 3 means X^2 is even and y^2 is odd. Had the result been 1, it was opposite. 

You can rewrite the equation to y^2= x^2-1771, so both y and x must be integers, x will have an even root and y will have an odd root. 
Nearest even integer after 42.08 is 44, so that is where I start. (x^2 has to be bigger than 42.08)

We start our trial and error: 
44^2-1771= y^2
46^2-1771= y^2
48^2-1771= y^2
If you calculate the first 3, they will generate a y^2, which is not a perfect square, that is, y will not be integer.  

But 50^2= 2500-1771= 729 and that gives the roots sqrt(2500)= 50 and sqrt(729)=27, so one solution is (50+27)=77 and the other is (50-27)=23
and 77*23= 1771
It follows the format (x+y)(x-y)= X^2-Y^2 and (50+27)(50-27)= 1771

If we could find a way of getting directly to either 2500 or 729, we would at the same time get a lead to solve some of the Millennium math. problems. I am trying, but have not succeeded.

When you go deeper into this, you might find some short cuts, which can reduce the number of trial and error, but currently there are no ways to reduce it down to just one single cycle. If you find it, let me know. 

In this case there are other solutions as well, because the prime composition of 1771 is 7*11*23 and we just solved for (7*11)*23
The product is not changing for other combinations, but the sum of (x+y) and the difference (x-y) is changing, which leads to different perfect squares, but with the same feature, that their difference is 1771.

If you only find ONE solution, your difference is a prime number. A prime number is always the difference of 2 consecutive squares and have no other solutions, than this combination, whereas composite numbers will at least have 2 solutions, the prime composition of 2 consecutive squares and at least one more. 

It is amazing and surprising, that there is no way but brute force, to factor an odd number.... however as long as that goes on, we have our financial transactions fairly safe, they rely on the excessive time, it takes to factor a product of 2 large prime numbers.