# 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?$

• I think writing $(x+iy)(x-iy) = (z-1)(z+1)$ might help. – Joel Cohen Oct 22 '11 at 22:52
• You are not trying to solve Project Euler problem 224, are you? projecteuler.net/problem=224 – starblue Oct 23 '11 at 13:15
• @starblue. No, it came up when I tried to make up an example in hyperbolic geometry. – TCL Oct 23 '11 at 16:55
• The question is essentially for which $z$ both $z-1$ and $z+1$ are the sum of two squares. There are some related questions asked before, such as math.stackexchange.com/questions/438818 and math.stackexchange.com/questions/46451. – Bart Michels Sep 8 '14 at 8:15
• I would look at Catalan’s [well-known] complete solution for $x_1^2+x_2^2+x_3^2=y_1^2$, and set $x_3 = a^2+b^2-c^2-d^2=1$. This implies another equal sums-of-squares equation $a^2+b^2=c^2+d^2+1$, so you probably have a nice orbit to chase. See also Spira's paper <jstor.org/stable/2312125>, etc.. – Kieren MacMillan Oct 6 '14 at 1:48

The equation defines a conic with a rational point (0,0,1). The other rational solutions can be parametrized by lines through that point. As with $x^2+y^2 = z^2$ the integer solutions can be deduced from the rational ones, and the quadratic form $x^2+y^2 - z^2$ has a large linear symmetry group allowing one to move between solutions. In these respects the theory is the same as the one for Pythagorean triples.

There is a difference in the structure of the symmetry group. For $a=0$ the hyperboloid $x^2+y^2 - z^2 = a$ becomes a cone, with additional scaling symmetries in addition to the linear transformations of the hyperboloid; in effect the $O(2,1)$ symmetry group of the rational solutions collapses into a product of scalings and circle isometries. For integer solutions, with Pythagorean triples there is a reduction to the case of primitive triples, but when $a \neq 0$ there is a bound on the shared factors of $(x,y,z)$, and for $a = \pm 1$ all integer solutions are primitive. The organization of Pythagorean triples using several 3x3 integer matrices as transformations connecting different solutions does use the $O(2,1)$ structure, and the solution set for the equation with $a \neq 0$ could be presented in the same way (possibly with more than one connected component when $|a| > 1$).

Note: This is not a complete answer. First, I want to point out that both $x$ and $y$ must be even.

We can trivially get one infinitely family of solutions from the following: Consider triplets of the form $$(x,y,z)=(2r^2,2r,2r^2+1).$$ Then they satisfy the above as $$(2r^2 )^2 +(2r)^2+1=(2r^2+1)^2.$$ This gives rise to $$(2,2,3), \ (4,8,9), \ (6,18,19),\ \cdots$$

the equation: $X^2+Y^2=Z^2-1$

Solutions can be written using the solutions of Pell's equation: $p^2-2k(k-1)s^2=1$

$k$ - given by us.

Solutions have form:

$X=2kps-2(k-1)s^2$

$Y=2(k-1)ps+2ks^2$

$Z=p^2+2(k^2-k+1)s^2$

And more:

$X=2p^2-2(3k-2)ps+2(2k-1)(k-1)s^2$

$Y=2p^2-2(3k-1)ps+2k(2k-1)s^2$

$Z=3p^2-4(2k-1)ps+2(3k^2-3k+1)s^2$

Although it should be a more general solution to record.

• I do not understand. And what you've edited? – individ May 11 '14 at 8:52

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.

For the equation: $qX^2+Y^2=Z^2+j$

In the case where a square: $a=\sqrt{\frac{j}{q}}$

Using equation Pell: $p^2-(q+1)s^2=1$

Then the solution can be written:

$X=2s(s\pm{p})L\pm{ap^2}+2aps\pm{a(q+1)s^2}=bL+af$

$Y=(p^2\pm2ps+(1-q)s^2)L\pm{ap^2}+2aps\pm{a(q+1)s^2}=cL+af$

$Z=(p^2\pm2ps+(q+1)s^2)L\pm{ap^2}+2a(q+1)ps\pm{a(q+1)s^2}=fL+at$

$L$ - any integer number given by us.

The most interesting thing is that these numbers are solutions of equations:

$qb^2+c^2=f^2$

$t^2-(q+1)f^2=\pm{q}$

If we use the equation Pell: $p^2-(q+1)s^2=k$

And substituting the solutions in the upper formula, we have solutions of the following equations.

$qb^2+c^2=f^2$

where: $c-b=k$

$t^2-(q+1)f^2=\pm{qk^2}$

True, I use this formula in reverse order. Find solutions of Pell's equation is much more complicated than the simple equations like Pythagorean triples. So find them and then have solutions of Pell's equation. The most interesting thing is that the solution of Pell related to Pythagorean triples.