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.

I think this comment by @MatthewLeingang explaining @lulu's comment answers the issue with my approach.

What lulu is saying by “not reversible” is that you have shown “If $a, b$, and $c$ are integers such that $a+b+c=1000$ and $a^2+b^2=c^2$, then $2c=1000− (ab/500)$.” That is not the same thing as “If $a$ and $b$ are integers and $2c=1000−(ab/500)$, then $a+b+c=1000$ and $a^2+b^2=c^2$.”

