Pythagorean Triple: $\text{Area} = 2 \cdot \text{perimeter}$ Find the unique primitive Pythagorean triple whose area is equal to twice the perimeter.
So far I set the sides of the triangle to be $a, b,~\text{and}~c$ where $a$ and $b$ are the legs of the triangle and c is the hypotenuse. 
I came up with 2 equations which are:
$\dfrac{ab}2 = 2(a+b+c)\;\;$  and  $\;\;a^2+b^2=c^2$
but I'm not sure how to proceed and solve for $a, b, c$.
 A: Rewrite the first equation as $c = \frac{ab}{4} - a - b$. Square it to get $$c^2 = a^2 + b^2 + \frac{a^2b^2}{16} - \frac{a^2b}{2} - \frac{ab^2}{2} + 2ab$$
Now using the other equation, we see that
$$\frac{a^2b^2}{16} - \frac{a^2b}{2} - \frac{ab^2}{2} + 2ab = 0$$
Since $a,b > 0$ divide by $ab$ and multiply by $16$ to get
$$ ab - 8a - 8b + 32 = 0$$
Use Simon's Favorite Factoring Trick to get $(a-8)(b-8) = 32$.
Now note that $a$ and $b$ are integers, so $(a-8)$ and $(b-8)$ must be factors of $32$. But factoring $32$ into anything except for $\{1,32\}$ gives you two even numbers - these can't be the legs of a primitive Pythagorean triple. Thus, we must have $a=9,b=40$, giving us the $(9,40,41)$ triangle.
A: Hint: isolate for c in both equations: 
$c=\frac{ab}4  - a - b$ and $c = \sqrt{a^2+b^2} $.  Now isolate for a or b and then substitute back into your equations.
A: Hint: formula for primitive triples is 
$a = mn; b = \frac {m^2 -n^2}2; c = \frac {m^2 + n^2}2$ for $\gcd(m,n) = 1$. And as $m^2 - n^2 $ is even $m$ and $n$ must both be odd.
So we want $\frac {mn(m^2 -n^2)}4 = 2(mn + \frac {m^2 - n^2}2 + \frac {m^2 - n^2} 2) = 2(mn + m^2)$
So $mn(m-n)(m+n) = 8m(m+n)$
So $n(m-n)=8$
For $n=1,2,4,8$ we have $m = 9,6,6,9$.  Only $n =1; m= 9$ have $\gcd(m,n) =1$ and $m^2 -n^2$ is even.
So solutions are $a = 9; b = 40; c=41$ 
====earlier answer with and an easier but not exhaustive formula for a triple ====
==== it worked out nicely, but it doesn't rule out that there aren't any others; nor did it guarentee I'd find a solution ===
Hint: Formula for primitive triples is $k, \frac {k^2 - 1}2, \frac {k^2+1}2$ where $k$ is odd.  Ex.  $3,4,5; 5,12,13; 7,24,25$ etc. 
So we need to solve $\frac {ab}2 = \frac {k (k^2 -1)}4 = 2(a+b+c) = 2(k + \frac {k^2 - 1}2 + \frac {k^2 + 1}2) = 2(k + k^2)$.
Has a very nice solution!.
A: With Euclid's formula $F(m,k)$, we can solve $R=$area/perimeter for $k$ and test a defined range of $m$-values to see which yield integers.
$$ \quad A=m^2-k^2,\quad B=2mk,\quad C=m^2+k^2\quad$$
$$R=\frac{area}{perimeter}=\frac{AB}{2P} =\frac{2mk(m^2-k^2)}{2(2m^2+2mk)}=\frac{mk-k^2}{2}$$
\begin{equation}
R=\frac{mk-k^2}{2}\quad\implies k=\frac{m\pm\sqrt{m^2-8R}}{2}\\ \quad\text{for}\quad \big\lceil\sqrt{8R}\big\rceil\le m \le (2R+1)
\end{equation}
The lower limit insures that $k\in \mathbb{N}$ and the upper limit ensures that $m> k$.
$$R=2\implies  \lceil\sqrt{8(2)}\rceil=4\le m \le (2(2)+1)=5 \\ 
m\in\{ 4\}\implies k\in\{ 2\}
 \qquad\land\qquad
m\in\{ 5\}\implies k\in\{ 4,1\}
$$
$$F(4,2)=(12,16,20)\qquad\land\qquad\frac{96}{48}=2\\
   F(5,4)=(\space 9,40,41)\qquad\land\qquad\frac{180}{90}=2\\
   F(5,1)=(24,10,26)\qquad\land\qquad\frac{120}{60}=2\\
$$
We can see that only one of these is primitive but this formula finds non-primitives as well.
