The inradius in a right angled triangle with integer side is r, if r = 4 the greatest perimeter is ?? The inradius in a right angled triangle with integer side is $r$,  if $r = 4$ the greatest perimeter is ??
My attempt- I know that $ r = (s-a)\tan \frac{A}{2}  $
Thus $ 2r = a+b-c $
I also know that $ a \le  b \lt c $
I also tried squaring both the sides and using Pythagorean theorem.
 A: The thing that makes this problem actually have a solution (rather than allowing the perimeter to go to infinity) is that the triangle must have integer sides.
Since the shorter leg of the triangle must be greater than $8$ and less than 
$8 + \sqrt{32} < 14$ (you can figure out why, if you like), there are only a few possible lengths the shorter leg can have. 
So one approach to the solution is, you could simply try each one.
If you think about what would make the perimeter greater or less without the integer-side restriction, you might have a clue which side length to try first and when to stop looking, which would save some effort.
Another possible approach is to use the formula for generating Pythagorean triples:
$c = m(p^2+q+2),$ $a = m(p^2 - q^2),$ $b = 2mpq.$
This will also get the answer, though it might still involve some trial and error.
A: If we use the following to generate Pythagorean triples, then inradius
$\space r=(2n-1)k.$
\begin{alignat*}{3}
&A=(2n-1)^2+{ } &&{}2(2n-1)k\\
&B=                    &&{}2(2n-1)k+2k^2\\
&C=(2n-1)^2+{ } &&{}2(2n-1)k+2k^2
\end{alignat*}
The factors of $\space 4 \space$ are $1\,|\,2\,|\,4\,$ and, since
$\space (2n-1)\space$ can only be odd, we have
$\space n=1, k=4\quad\land\quad F(1,4)= (9,40,41).\qquad$
There are no other primitive triples with an inradius of $\space 4\space$ so the perimeter
$\space p=9+40+41=90$.
