Can $(q,p)$ and $(p-q,p)$ be legs of a Pythagorean Triple I'm searching to prove that there's no (or to find an example of) $p$ and $q$ coprimes, and $n,m$ integers such that:
$q^2 + p^2 = n^2$
$(p-q)^2 + p^2 = m^2$
I conjecture that this case is impossible. Do you have any idea of how to prove or disprove it ?
So far:
I was only able to prove that in this case $p$ must be even: since there's at least one number that is even in a pythagorean triple, it must be $p$, else there'll be a contradiction with the parity of $q$ and $p-q$.
Also, (thanks to Mark Bennet), one of $p$ and $q$ (this a general property for pythagorean triples) must be a multiple of $3$. Suppose $q$ is a multiple of $3$, then $p$ is not (there are coprimes). Then $p-q$ is a multiple of three minus a non-multiple of three, meaning $p-q$ is a non-one. But this leads to a contradiction, because one of $p-q$ or $p$ must be a multiple of $3$. This means that $q$ can't be a multiple of $3$ (which was our assumption), which implies that $p$ is.
All of this leads to $p = 6p'$ with $p'$ an integer, and also that $q \equiv 1 \pmod 6$ or $q \equiv 5 \pmod 6$.
Special cases: note that in general if a value of $q$ is impossible, then the value $p-q$ is impossible too.

*

*$q = p$ (or $q = 0$) is impossible, because in the first case $p^2 + p^2 = 2p^2$ which can't be a perfect square. This implies that $q^2 + p^2 > p^2 \iff q^2 + p^2 \geq (p+1)^2 \iff q^2 \geq 2p+1$.

*$q = 1$ is impossible, because $1$ can't be coprime with $p$.

*$q = 2$ is impossible because there's no pythagorean triple with a $2$ in it.

*$q = 3$ is impossible because it only appears in the triple $(3,4,5)$ (for $a > 5, a^2 - (a-1)^2 = 2a - 1 > 9 = 3^2$) and $p-q = 2$ can't be in a pythagorean triple.

*$q = 5$ ?

*$q = 7$ ?

*$q = 11$ ?

*$q = 13$ ?

We can also make tests for $p$. Thanks to Misha Lavrov, there's no solution for all $p < 10^7$!
Inequalities:
Because $p = 0$ is not interesting (this will implies that $q$ and $p$ aren't coprimes) we have:
$q^2 + p^2 > q^2 \iff q^2 + p^2 \geq (q+1)^2 \iff p^2 \geq 2q+1 \iff q \leq \frac{p^2 - 1}{2}$, which gives an upper bound. This also gives us the lower bound $q \geq \sqrt{2p+1}$ and we have the same for $p$.
Applying it to $p-q$ we get: $(p-q)^2 \geq 2p+1 \iff p^2 - 2pq + q^2 \geq 2p+1$ And then: $q^2 - 2pq + p^2 - 2p - 1 \geq 0 \iff p^2 - 2p(q+1) + q^2 - 1 \geq 0$.

*

*We can solve for $q$, $\Delta = 4p^2 - 4(p^2 - 2p - 1) = 4(2p+1)$, and we have the two roots of the polynomial $x_1 = p - \sqrt{2p+1}$ and $x_2 = p + \sqrt{2p+1}$, meaning (if $p \geq -\frac{1}{2}$) we have $q \leq p - \sqrt{2p+1}$ or $q \geq p + \sqrt{2p+1}$.


*And we can solve for $p$, $\Delta = 4(q+1)^2 - 4(q^2 - 1) = 4q^2 + 4q + 4 - 4q^2 - 4 = 4q$. We have the two roots of the polynomial $x_1 = q+1-\sqrt{q}$ and $x_2 = q+1 + \sqrt{p}$, meaning (if $q \geq 0$) we have $p \leq q+1-\sqrt{q}$ or $p \geq q+1+\sqrt{q}$.
I think other inequalities should be useful, perhaps we can make ones with the fact that $p$ is a multiple of $6$.
If we need some information about pythagorean triples.
 A: This is an elliptic curve, which is given as intersection of two quadrics.
For more details and references, see e.g. the GTM book by Silverman, The Arithmetic of Elliptic Curves.

We write $n = q + u$ and $m = q + v$. After simplification, we get
\begin{eqnarray}
2qu &=& p^2 - u^2\\
2q(p + v) &=& 2p^2 - v^2.
\end{eqnarray}
which then leads to
$$(p^2 - u^2)(p + v) = (2p^2 - v^2)u.$$
Viewing $[p, u, v]$ as projective coordinates, this is a plane cubic curve, with a rational point $(p, u, v) = (0, 0, 1)$.
Therefore we get an elliptic curve. We can use a computer algebra system to compute its rational points.
Paste the following code into this page and press "Evaluate".
R.<p, u, v> = QQ[]
E = EllipticCurve((p^2 - u^2) * (p + v) - (2*p^2 - v^2) * u, [0, 0, 1])

print(E)
print(E.rank())
print(E.torsion_points())

The output:
Elliptic Curve defined by y^2 - 2*x*y - 2*y = x^3 + 5*x^2 + 8*x + 4 over Rational Field
0
[(-2 : -2 : 1), (-2 : 0 : 1), (-1 : 0 : 1), (0 : 1 : 0)]

The first line gives us a Weierstrass form of the curve.
The second line tells us that the Mordell-Weil group has rank $0$. Thus all rational points are torsion.
The third line lists out all torsion points. There are only $4$ of them. They correspond to the points $[p, u, v] = [-1, 0, 1], [0, 1, 1], [0, 1, 0], [0, 0, 1]$ in our model.
This shows that there is no non-trivial solution.
