All Pythagorean triples are generated by
\[(m^2-n^2,2mn,m^2+n^2\]
.The perimeter of the triangle is
\[m^2-n^2+2mn+m^2+n^2=2mn+2m^2=2m(n+m)\]
.The area of the triangle is
\[\frac{1}{2} (2mn)(m^2-n^2)=mn(m^2-n^2)=mn(m+n)(m-n)\]
.Equating these gives
\[2m(m+n)=mn(m+n)(m-n)\]
\[2m(m+n)-mn(m+n)(m-n)=0\]
\[m(m+n)(n^2-mn+2)=0\]
We must have
\[n^2-mn+2=0 \rightarrow n=\frac{--m \pm \sqrt{m^2-8}}{2}\]
.\[m^2-8\]
must be a square number and the only possibility is \[m=3 \rightarrow \sqrt{3^2-8}=1\]
then \[n= \frac{--3 \pm 1}{2}=2, \; 1\]
. The only possible triangles are\[(3^2+2^2,2 \times 3 \times 2,3^2+2^2)=(5,12,13)\]
\[(3^2-1^2,2 \times 3 \times 1,3^2+1^2)=(8,6,10)\]