In completing questions regarding primitive pythagorean triples and solving for the values $u, v$ in Euclid's formula, $$u^2-v^2, 2uv, u^2+v^2$$ I noticed that when the first of the triple, i.e. $u^2-v^2$, is prime, the solution of $u$ and $v$ is seemingly trivial.
For example, take the prime 89, divide by 2, resulting in $44$ remainder 1. Now you have a "bigger half" of $45$ and a "smaller half" of $44$. Simply input these values as $u$ and $v$ (where $u > v$). Voila, you have a pythagorean triple. I've only tested this so many times on different primes, even seeing it work on composites.
What I don't understand is the (potentially very obvious and very simple explanation) as to why this works. I'm not sure what to google, or at least my attempts have failed spectacularly, but I'm assuming this is a known property (?). Or at least it's just completely false and I got lucky in some tests.
Thanks all the same for any explanations.
I assume that all (or atleast most) of the composite numbers you’ve experimented with have been odd numbers. I will come to that in a while.
We know that a prime number has only two divisors, 1 and itself. This means that if we have two distinct positive factors multiplying to give a prime $p$ then IT MUST SO HAPPEN that one of the factors is $1$ and the other is $p$.
Let us have $u^2-v^2=p$ where $p$ is an odd prime (The case $p=2$ can be dealt separately). Then, $$(u-v)(u+v)=p$$ so that one of the factors is equal to $1$. But $u-v$ is smaller than $u+v$ so we have $$u-v=1,$$$$u+v=p$$ which on solving gives us $\ \displaystyle u=\frac{p+1}{2}, \ v=\frac{p-1}{2}$. As you can notice, these are very close to $\dfrac p2$.
Now to why I made my initial comment: If you notice, then composite numbers, say $s$, can also be written as $s\cdot1$ and the previous calculation redone. But then, $s\pm1$ would have to be divisible by $2$ for the two numbers to be integers; this implies that $s$ must be odd to get integer solutions with the method you’ve described.