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.


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