<s>[INST] Number of triangles with integer sides Total number of right angle triangles whose inradius is $2013$ and sides are integer
Attempt: assuming that $a,b,c>0$ are the sides of a triangle.
so form a right angle triangle with sides $a,b,c$ and right angle at $C$
$\displaystyle r=(s-c)\tan \frac{C}{2}=(s-c)=\frac{a+b-c}{2}$ and $c^2=a^2+b^2$
$\displaystyle 2r = a+b-\sqrt{a^2+b^2}$ so $(\sqrt{a^2+b^2})^2 = (a+b-2r)$ 
$\displaystyle a^2+b^2 = (a+b)^2+4r^2-4r(a+b) = a^2+b^2+2ab-4r(a+b)$
$\displaystyle ab-2r(a+b)=0$
Could someone help me how to solve it, thanks.
 [/INST] Remember the Pythagorian triple $(a,b,c)$ where
$$c=m^2+n^2, b=m^2-n^2,a=2mn. $$ We know that such triple defines a right triangle. The additional condition $$ab=2r(a+b)-2r^2 $$
implies that $$2mn(m^2-n^2)=2r(m^2-n^2+2mn)-2r^2 .$$
Now finding $m $ and $n$ answers your question.
</s>