<s>[INST] Integral solutions of $x^2+y^2+1=z^2$ I am interested in integral solutions of $$x^2+y^2+1=z^2.$$ Is there a complete theory comparable to the one for $x^2+y^2=z^2?$
 [/INST] All of numbers can be any character.In Equation:  $qX^2+Y^2=Z^2+a$  
If the ratio is factored so:  $a=(b-c)(b+c)$ 
Then we use the solutions of Pell's equation: $p^2-fs^2=\pm1$ 
where:  $f=(q+1)k^2-2kt-(q-1)t^2$ 
Then the solutions are of the form: 
$X=2(ck-bt)ps+2(bk^2-(b+c)kt+ct^2)s^2$ 
$Y=bp^2+2c(k-t)ps-(b(q-1)k^2+2(b-qc)kt+b(q-1)t^2)s^2$  
$Z=cp^2+2b(k-t)ps+(c(q+1)k^2-2(bq+c)kt+c(q+1)t^2)s^2$ 
All of numbers can be any character.
</s>