Solving a Complex Diophantine Equation with One Known I am struggling to find a way to implement Euclid's Algorithm in order to solve this diophantine equation. The $N$ will be known and the set of solutions I wish to find will be a set of decreasing $X$ solutions that satisfy $$x^2 - 4  y^2 = n.$$
When simplifying I have concluded that the solution could be as follows...
$$x^2 - 4 y^2 = (x - 2y)  (x + 2y)$$ when $n = 12$,
$$12 = (x - 2y) (x + 2y)$$
would it be possible to use Euclid's Algorithm to solve for the GCD in decreasing order?
The poposed solutions are a set of $n=12$, $x = 4$ and $y = 1$.
 A: Say $12=(x+2y)(x-2y)=ab$, where $x$ and $y$ are positive integers,
with $x+2y=a, $ and $x-2y=b$.  Then $a>b$, and $2x=a+b$.
That means $a+b$ must be even, so $a$ and $b$ are both odd or both even.
But $a$ and $b$ cannot be both odd, since $ab=12$ is even.
Therefore, $a$ and $b$ are both multiples of $2$.
Since $12=2\times2\times3=ab$, it follows that $a=2\times3$ and $b=2$,
so $x=(a+b)/2=4$ and $y=1$.
A: In response to your request for the detailed translated answer, you could would it out with algebra but I have more experience with these equations so it will be easier for me. I never heard of "discord" until you asked if I used it and the answer is "no". WolframAlpha is popular on this forum.
In the other answer we identified the "adjusted" Euclid's formula
$$x=m^2+k^2\qquad y=mk\qquad n=(m^2-k^2)^2$$
$$n=(m^2-k^2)^2
\quad\implies\quad k = \sqrt{m^2-\sqrt{n} }\\
 \text{for}\quad 
\big\lceil\sqrt{\sqrt{n} - 1}\space\big\rceil 
\le
 m\le 
\frac{\sqrt{n}+1}{2}$$
The lower limit ensures that $k\in\mathbb{N}$ and the upper limit insures that $k<m$
For $n=225$ we know the solutions are $\quad(17,4,225)\land(113,56,225)$
$$n=225\implies \big\lceil\sqrt{\sqrt{225} - 1}\space\big\rceil =4
\le m \le 
\frac{\sqrt{225}+1}{2}=8\\
\quad\land\quad m\in\{4,8\}\implies k\in\{1,7\}$$
$$
x=m^2+k^2\qquad y=mk\qquad n=(m^2-k^2)^2\implies$$
$$F(4,1)\rightarrow x=4^2+1^2=17\quad y=4(1)=4\quad n=(4^2-1^2)^2=225\\
F(8,7)\rightarrow x=8^2+7^2=113\quad y=8(7)=56\quad n=(8^2-7^2)^2=225$$
