Solve Euler Project #9 only mathematically - Pythagorean triplet The "Euler Project" problem 9 (https://projecteuler.net/problem=9) asks to solve:
$a^2$ + $b^2$ = $c^2$
a + b + c = 1000
I find answers solving it with brute-force and programmatically, but is there a way to solve the problem ONLY mathematically? Can someone help, please?
Problem as explained in Project Euler website:

A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,

a^2 + b^2 = c^2
For example, 3^2 + 4^2 = 9 + 16 = 25 = 52.

There exists exactly one Pythagorean triplet for which a + b + c = 1000.

Find the product abc.

 A: The triplets are all of the form
$a=u(n^2-m^2),
b=2umn,
c=u(n^2+m^2)
$
with $n > m$
so
$a+b+c
=u(2n^2+2mn)
=2un(n+m)
$.
We must have
$n > m$.
Therefore
$500
=un(n+m)
$.
If
$500 = rst
$
with
$s < t$
then
$u = r,
n = s,
n+m = t
$
so
$m = t-n
=t-s
$.
We must have
$n > m$
so
$s > t-s$
or
$s < t < 2s$.
Playing around a bit,
$500 = 1*20*25$,
so,
swapping $m$ and $n$,
$u = 1, m = 5,
n=20
$
and the sides are
$20^2-5^2 = 375 = 25\ 15,
2\ 20\ 5 = 200 = 25\ 8,
20^2+5^2 = 425 = 25\ 17
$.
A: It is known that all primitive Pythagorean triples (i.e with no common factors) is of the form $(m^2-n^2,2mn,m^2+n^2)$ for relatively prime $m$ and $n$ where one is even and the other is odd.
Based on that, you are looking for $m$ and $n$ such that $$(m^2-n^2)+2mn+(m^2+n^2)=2m^2+2mn=2m(m+n)$$ is a factor of $1000$.
A: Hint Euclid's parameterization of the Pythagorean triples (Elements, Book X, Proposition XXIX) is:
$$a = k (m^2 - n^2), \qquad b = 2 k m n, \qquad c = k (m^2 + n^2),$$
where $m > n > 0$ and $m, n$ coprime and not both odd.
Substituting in our condition gives
$$1000 = a + b + c = 2 k m (m + n),$$ and clearing the constant leaves $$\phantom{(\ast)} \qquad 500 = k m (m + n) . \qquad (\ast)$$
Now, notice that (1) $500 = 2^2 5^3$ has only two distinct prime factors, and (2) since $m$ and $n$ are coprime, so are $m$ and $m + n$.

So, one of $m, m + n$ must be one of $1, 2, 4$ (in fact one of $2, 4$, since $m > n > 0$ implies $m + n > m > 1$) and the other must be one of $1, 5, 25, 125$. Because $m + n > m$, we must have $m \in \{2, 4\}$, and so $m + n < 2 m \leq 8$. Thus, $m + n = 5$, and $2 m > m + n = 5$ implies $m \geq 3$, leaving $m = 4$ as the only possibility. So, $n = 1, k = 25$, and $$\color{#df0000}{\boxed{(a, b, c) = (375, 200, 425)}} .$$

A: Given perimeter: $\qquad P=(m^2-n^2 )+2mn+(m^2+n^2 )=2m^2+2mn\qquad $ If we solve for $n$, we can find if there exists one or more $m,n$ combinations for a Pythagorean triple with that perimeter. Any value of $m$ that yields an integer $n$ gives us such an $m,n$ combination. We let:
$$n=\frac{P-2m^2}{2m}\quad where \quad \biggl\lceil\frac{\sqrt{P}}{2}\biggr\rceil\le m \le \biggl\lfloor\sqrt{\frac{P}{2}}\biggr\rfloor$$
Here, the lower limit ensures that  $m>n$ and the upper limit insures that $n>0$. For example:
$$P=1000\implies \biggl\lceil\frac{\sqrt{1000}}{2}\biggr\rceil =16\le m \le \biggl\lfloor\sqrt{\frac{1000}{2}}\biggr\rfloor=22$$
In this range, we find that only $20$ is a factor of $1000$ and the only value of $m$ that yields and integer $n$. We find that $m=20\implies n=5$, and, using Euclid's formula $F(m,n)$, we have $F(20,5)=(375,200,425)$. Then, the product, as I understand it, is $$A\times B\times C=375\times200\times425=31875000.$$
