What is my mistake in finding this pythagorean triplet? Since Project Euler copyright license requires that you attribute the problem to them, I'd like to add that this is about question 9 there.
I am trying to solve this problem on only two brain cells and can't figure out what am I doing wrong. Here is the system for $(a, b, c) \in \mathbb{N}^3$,
\begin{align*}
a^2 +b^2 &= c^2 \\
a+ b + c &= 1000 \\
a &< b < c
\end{align*}
Here is my approach,
\begin{align*}
a + b + c &= 1000 \\
a + b &= 1000 - c &&\text{Subtract } c\\
a^2 + b^2 + 2ab &= 1000^2 + c^2 - 2000c &&\text{Square both sides}\\
c^2 + 2ab &= 1000^2 + c^2 - 2000c &&\text{Since }a^2 +b^2 = c^2\\
2ab &= 1000^2 - 2000c &&\text{Subtract } c^2\\
\frac{ab}{500} &= 1000 - 2c &&\text{Divide } 1000\\
2c &= 1000 - \frac{ab}{500} &&\text{Rearrange}\\
\end{align*}
Now let $a=5,b=200$,
\begin{align*}
2c &= 1000 - 2\\
2c &= 998 \\
c &= (998 \div 2) = 499 \\
\end{align*}
But certainly these values do not work. I can't see why.

One problem is the assumption that $\quad 5^2+200^2=795^2.\quad $ There are no "small" triples with side differences of two orders of magnitude. The $b$-value is good but the following solution provides the $a$-value to "fit" your logic and the $c$-value will be shown to match your "solution" in the last equations below.
If we assume that $a$ is odd and  $b$ is even, then the rules are that $a$ is any odd number greater that $1,\space$ $b$ is a multiple of  $4,\space$ and $c$ must be of the form $4n+1$. Experimentally, a spreadsheet can show that one solution is $(375,200,425).\quad$ Alternatively, the following works if only paper and a calculator are available.
We begin with Euclid's formula where
$$ \qquad A=m^2-k^2\qquad B=2mk \qquad C=m^2+k^2\qquad$$
Since $a$ is every $2nd$ integer but $b$ is every $4th$, it is faster to try $b$-values using the following formula, where any integer solution yields a valid triple.
\begin{equation}
B=2mk\implies k=\frac{B}{2m}\qquad\text{for}\qquad \bigg\lfloor \frac{1+\sqrt{2B+1}}{2}\bigg\rfloor \le m \le \frac{B}{2}
\end{equation}
The lower limit ensures $m>k$ and the upper limit ensures $m\ge 2$
$$B=200\implies\qquad \bigg\lfloor \frac{1+\sqrt{400+1}}{2}\bigg\rfloor =10 \le m \le \frac{200}{2}=100\\
 \land \quad m\in\{20,25\}\implies k\in\{5,4\}$$
$$f(20,5)=(375,200,425)\qquad f(25,4)=(609,200,641)$$
We can see that $f(20,5)$ is the only solution where $a+b+c=1000.\quad$ This required testing only $11$ $m$-values for $b=200.$
If we try these "assumed" values in your equations we get
$$2c=1000-\frac{ab}{500}
=\frac{500,000-75000}{500}
=850$$
$$c=425$$
If you require that $a<b<c$, use $(200,375,425).\quad$
