<s>[INST] Pythagorean Triplets with "Bounds" I am interested in the algebraic/geometric way of finding the pythagorean triplets such that
$$a^2 + b^2 = c^2$$
$$a + b + c = 1000$$
I do the obvious
$$a + b = 1000 - (a^2 + b^2)^{1/2}$$
$$a^2 + b^2 = 1000^2 -2(1000)a - 2(1000)b +2ab + a^2 +b^2$$
$$2a + 2b - \frac{2ab}{1000} = 1000$$
$$a + b -\frac{ab}{1000} = 500$$
I have no idea what to do at this point. I can't separate the variables, and any geometric solution is beyond my reach. The only other thing I can think of is writing
$$a + b = 500 + \frac{ab}{1000} = 1000 - c$$
But this is going backwards
 [/INST] The following is copy and pasted directly from Yahoo Answers
All Pythagorean triples are generated by ${m^2+n^2, m^2-n^2, 2mn}$, where $m$ and $n$ are positive integers, and $m\gt n$.
You need $a+b+c=1000$, yielding $m(m+n)=500$. So, $m$ and $(m+n)$ are factors of $500$.
$m+n\gt m$, so $m(m+n)\gt m^2$, so $m\lt \sqrt{(500)}$,
and
$m+n\lt2m$ (since $m\gt n$), so $m(m+n)\lt2m^2$, so $m\gt \sqrt{(250)}$.
The prime factorisation of 500 is $2 \cdot 2 \cdot 5 \cdot 5 \cdot 5$, so the only factor of $500$ between $15.8$ and $22.4$ is $20$.
Thus, $m=20$, $n=5$, giving the answer required:
$m^2+n^2$ $= 425$;
$m^2-n^2 = 375$;
$2mn = 200$.
</s>