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}$$


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.
