Diophantine Equations – Integer Solutions to x^2 – y^2 = 33

diophantine equationspell-type-equations

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!

Best Answer

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$.

Related Question