Near-Pythagorean triplets: What are the general solutions to $a^2+b^2=c^2-1$? Obtaining the most general solution to a quadratic Diophantine equation in three variables is often easier if the equation is homogeneous.  For example, by focusing on "primitive" solutions, it is easy to show that all Pythagorean triplets can be written as $$a=m(r^2-s^2), b=2mrs, c=m(r^2+s^2)$$ and that if you restrict to $(r,s)=1, r\neq s \mod  2$ no triplet is repeated.
Inhomogeneous equations can be tougher.  In two variables, Pell's equation $x^2-ny^2$ is well studied, but I wanted to look at three variables.  An example is
$$
a^2+b^2=c^2+1
$$
which is solved by taking an arbitrary integer $r>1$ and an arbitrary integer factor $u | r(r-1)$, with $$u>\sqrt{2r^2-2r-1}-r+\frac12$$  and $u^2<r(r-1)$. (These restrictions ensure uniqueness and non-negativity). The solution is then
$$
a= \frac{r(r-1)}{u}-u \\ b=2r-1 \\ c=\frac{r(r-1)}{u}+u
$$
Note that the solutions are generated requiring no more difficult operations than factoring $r(r-1)$.
The next obvious case to try was $$a^2+b^2=c^2-1$$
We can see that $a$ and $b$ must both be even, and transform this using $a=2x,b=2y,c=2z-1$, to $$x^2+y^2=z^2-z$$ Here, $x$ and $y$ must be of the same parity.
I have pursued the odd-parity case by transforming to $x=2r-1,y=2s-1,z=8u+2$, which comes down to finding solutions to
$$
r(r-1)+s(s-1)=2u(8u+3)
$$
and with this, for small-ish values of $u$, you can generate
$$ (18,6,19), (30,18,35), (50,10,51), (38,34,51) $$
and so forth.  But this does not resolve the question since $$r(r-1)+s(s-1)=2u(8u+3)$$ is just another inhomogeneous quadratic Diophantine equation, and I have not been able to find a generic solution to that either.
So my question is:

What is the general solution to $$\mathbf{a^2+b^2=c^2-1}$$

 A: I'm not sure this is the type of solution you were looking for, since it's not a parametrization like we have for the Pythagorean triples, but it's similar to the one you posted to the equation with the positive sign it just takes a little more work with the factorization.
From the solution $(0,0,1)$, trace the line $\{(t,pt,qt+1)|t\in\mathbb{R}\}$. Notice that by varying $p,q,t$ we get all points in $\mathbb{Q}^3$, so fix $p,q$ and solve for $t$
$$t^2+p^2t^2=(qt+1)^2-1$$
$$t=\frac{2q}{1+p^2-q^2}.$$
Therefore all other solutions are of the form $\left(\frac{2q}{1+p^2-q^2},\frac{2pq}{1+p^2-q^2},\frac{1+p^2+q^2}{1+p^2-q^2}\right)$ for $p,q\in\mathbb{Q}$. You can let $p=\frac xz$, $q=\frac yz$ and you have that the solutions are of the form
$$\left(\frac{2yz}{z^2+x^2-y^2},\frac{2xy}{z^2+x^2-y^2},\frac{x^2+y^2+z^2}{z^2+x^2-y^2}\right)$$
for integers $x,y,z$, you just have to require these to be integers.
A: This is equivalent to $a^2 + 1 = c^2 - b^2$
Since $c^2-b^2 = (c-b)(c+b)$
It follows that $a^2+1$ must factor into two integers of the same parity.
For example, since $5^2+1=26 =26 \cdot 1 = 13 \cdot 2$, there is no solution that has $a=5$.
But $8^2+1 = 65 = 65\cdot 1 = 13\cdot 5$. So
$$(a,b,c) = (8,32,33)=(8,4,9)$$

*

*So suppose we pick some value of $a$ and $a^2+1 = uv$ where u and v are positive integers of the same parity.


*Then $c = \dfrac 12(u+v)$ and $b = \dfrac 12(u-v)$
So the problem now is to find positive integers $u$ and $v$ of the same parity such that $a^2 = uv - 1$
So I have a very small theorem.
If $u$ and $v$ have the same parity ($u > v$) and $uv = a^2+1$, then $(a,b,c) = (a, (u-v)/2, (u+v)/2)$$
A: This is only a partial answer. I managed to find several families of solutions:
Family 1
$$
\begin{align}
a &= 2\left[(4k^2+1)n \pm k\right],\\
b &= 2\left[(4k^2+1)n^2 \pm 2kn - k^2\right],\\
c &= 2\left[(4k^2+1)n^2 \pm 2kn - k^2\right] + 4k^2 + 1.
\end{align}
$$
Family 2
$$
\begin{align}
a &= 2\left[\left(2k(k+1)+1 \vphantom{1^1} \right)n \pm k^2\right],\\
b &= 2\left[\left(2k(k+1)+1 \vphantom{1^1} \right)n^2 \pm 2k^2n - k\right],\\
c &= 2\left[\left(2k(k+1)+1 \vphantom{1^1} \right)n^2 \pm 2k^2n - k\right] + 2k(k+1)+1.
\end{align}
$$
Here, $k$ and $n$ are integers such that $a,b,c$ are positive integers.
I also found solutions for which I have not yet found a generalization:
$$
2(29n\pm 6),\quad 2(29n^2 \pm12n -6),\quad 2(29n^2 \pm12n -6) +29,\\
2(53n\pm15),\quad 2(53n^2\pm30n -9),\quad 2(53n^2\pm30n -9) + 53,\\
2(73n\pm23),\quad 2(73n^2\pm46n - 11),\quad 2(73n^2\pm46n - 11) + 73.
$$

EDIT
I found a recursion: if $(a, b, c)$ is a solution to $a^2 + b^2 = c^2 - 1$, then the three triples
$$
\begin{align}
a' &= 2(a+c-b) - a\\
b' &= 2(a+c-b) + b\\
c' &= 2(a+c-b) + c,
\end{align}
$$
$$
\begin{align}
a' &= 2(b+c-a) - b\\
b' &= 2(b+c-a) + a\\
c' &= 2(b+c-a) + c,\\
\end{align}
$$
$$
\begin{align}
a' &= 2(a+b+c) - b\\
b' &= 2(a+b+c) - a\\
c' &= 2(a+b+c) + c,\\
\end{align}
$$
are all solutions as well. Starting with the trivial solution $(0,0,1)$, I'm reasonably confident that this will generate all solutions. Unfortunately, I haven't found a closed-form expression.
A: Solutions in positive integers are( with $p>0$):
$a=8p^{4}-4p^{2}$,
$b=8p^{3}$,
$c=1+8p^{4}$.
.
