All primitive Pythagorean triples with $y=2x+1$ and $y<1000$ This is the final part of a question in which I have previously shown that $60$ divides $xyz$ for any primitive Pythagorean triple $(x,y,z)$. (Maybe this is relevant but I can't see why).
I am trying to find all primitive Pythagorean triples with $y=2x+1$ and $y<1000$ but I am getting nowhere. I have tried doing different things with the $x=2st, y=s^2-t^2, z=s^2+t^2$ formula but I don't seem to be getting anywhere (where I don't have to check hundreds of cases for $s$ or $t$).
 A: You have the right idea with what you tried. In particular, with $x = 2st$ and $y = s^2 - t^2$, you thus get
$$\begin{equation}\begin{aligned}
& y = 2x + 1 \\
& s^2 - t^2 = 2(2st) + 1 \\
& s^2 - 4st - t^2 - 1 = 0 \\
& s^2 - 4t(s) + (- t^2 - 1) = 0
\end{aligned}\end{equation}\tag{1}\label{eq1A}$$
Next, consider \eqref{eq1A} to be a quadratic in $s$. Using the quadratic formula, you then get
$$\begin{equation}\begin{aligned}
s & = \frac{4t \pm \sqrt{(4t)^2 - 4(-t^2 - 1)}}{2} \\
& = \frac{4t \pm \sqrt{20t^2 + 4}}{2} \\
& = 2t \pm \sqrt{5t^2 + 1}
\end{aligned}\end{equation}\tag{2}\label{eq2A}$$
For $s$ to be an integer requires that $5t^2 + 1$ be a perfect square, i.e., there needs to be an integer $u$ such that
$$5t^2 + 1 = u^2 \implies u^2 - 5t^2 = 1 \tag{3}\label{eq3A}$$
Note this is of the form of a Pell's equation. As shown in that Wikipedia article, $n = 5$ in your case, with $u$ here being $x$ there and $t$ here being $y$ there. The smallest solution of Pell equations section gives the smallest (i.e., fundamental) solution is with $n = 5$, using $u$ and $t$,
$$u_1 = 9, \; t_1 = 4 \tag{4}\label{eq4A}$$
You can easily confirm that $9^2 - 5(4^2) = 81 - 80 = 1$. Using this in \eqref{eq2A} gives, since you only want the positive value of $s$, that $s_1 = 2(4) + 9 = 17$. This then gives $x = 2(17)(4) = 136$ and $y = 2(136) + 1 = 273$.
Also, the rest of the solutions can be determined from this fundamental solution using the recursive formula given in the Additional solutions from the fundamental solution section
$$u_{k+1} = u_1 u_{k} + 5t_1 t_k \tag{5}\label{eq5A}$$
$$t_{k+1} = u_1 t_{k} + t_1 u_k \tag{6}\label{eq6A}$$
For the next set of values, this gives $u_2 = u_1(u_1) + 5(t_1)(t_1) = 9(9) + 5(4)(4) = 161$ and $t_2 = 9(4) + 4(9) = 72$. Also, you have $161^2 - 5(72^2) = 25921 - 25920 = 1$. As before, this gives $s_2 = 2(72) + 161 = 305$. This then gives $x = 2(305)(72) = 43920$ and $y = 2(43920) + 1 = 87841$. As you can see, this is already $\gt 1000$. Also, \eqref{eq5A} and \eqref{eq6A} shows the values of $u_{k+1}$ and $t_{k+1}$ are increasing, so $s_{k+1}$ will also be increasing, which means all other corresponding values of $y$ will also be larger. As such, the only set of $x$ and $y$ values which meet your requirements is $(136,273)$ mentioned earlier.
