Numbers expressible as sum of 2 squares in 2 distinct ways I was trying this question here which goes like:

Find numbers which are squares and can be expressed as $x^2y^2-x^2-y^2+2$ for non-consecutive positive integers only.

Let the number be $a$
\begin{align*}
a^2 &= x^2y^2-x^2-y^2+2 \\
a^2-1 &= (x^2-1)(y^2-1) \\
&=(x-1)(x+1)(y-1)(y+1) \\
\text{Rearranging, }\\
&= \underbrace{(x-1)(y+1)}_{\text{First factor}} \text{  }\underbrace{(x+1)(y-1)}_{\text{Second factor}}\\
&=(\color{red}{xy-1}+\color{blue}{x-y})(\color{red}{xy-1}-\color{blue}{(x-y)}) \\
&= \color{red}{(xy-1)^2}-\color{blue}{(x-y)^2} \\
\text{So,   } a^2-1&=(xy-1)^2-(x-y)^2 \\
\text{When $x-y= \pm1$, (consecutive) } \\
a = |xy-1| &= |(x(x\pm 1)-1)|=|x^2\pm x-1| \\
\text{Or else, }\\
a^2+(x-y)^2 &= 1+(xy-1)^2\\
\text{Let $x-y=t$ and $xy-1=u$, then } \\
a^2 + t^2&= 1^2 +u^2 = p \text{  (say)} \\
\end{align*}
So, I think we need to look at numbers which can be expressed as sum of 2 squares in 2 distinct ways, with 1 being one of the squares in one case.
For example, $$5^2 + 5^2 =1^2 + 7^2 = 50$$
Now, is there some general form for such numbers? Or some way in which I could generate them? How do I proceed? Also, is there some flaw in my work so far?
(I'm NOT looking for solutions to the problem I linked. I want some ideas to proceed with MY ATTEMPT)

The condition $(x^2-1)(y^2-1)+1=a^2$ implies that the set $\{1,x^2-1,y^2-1\}$ is a Diophantine triple see (e.g. here), i.e. the product of any two of its distinct elements increased by $1$ is a perfect square. For fixed $x$, finding $y$ leads to Pellian equation $a^2 - (x^2-1)y^2 =-x^2$. It has infinitely many solutions: $y=1$, $y=x\pm 1$, $y=2x^2\pm 2x-1$, $y=4x^3 \pm 4x^2-3x \mp 1$, ... . E.g. for $y=2x^2+2x-1$ we get $a=2x^3 +2x^2 −2x−1$, and $x=2$ gives $a=19$ and the triple $\{1,3,120\}$, which is subtriple of the famous Fermat's quadruple $\{1,3,8,120\}$.  
