6. [4] Let $A B C$ be a triangle in the coordinate plane with vertices on lattice points and with $A B=1$. Suppose the perimeter of $A B C$ is less than 17. Find the largest possible value of $1 / r$, where $r$ is the inradius of $A B C$.
Answer: $1+5 \sqrt{2}+\sqrt{65}$
Solution: Let $a$ denote the area of the triangle, $r$ the inradius, and $p$ the perimeter. Then $a=r p / 2$, so $r=2 a / p>2 a / 17$. Notice that $a=h / 2$ where $h$ is the height of the triangle from $C$ to $A B$, and $h$ is an integer since the vertices are lattice points. Thus we first guess that the inradius is minimized when $h=1$ and the area is $1 / 2$. In this case, we can now assume WLOG that $A=(0,0), B=(1,0)$, and $C=(n+1,1)$ for some nonnegative integer $n$. The perimeter of $A B C$ is $\sqrt{n^{2}+2 n+2}+\sqrt{n^{2}+1}+1$. Since $n=8$ yields a perimeter greater than 17 , the required triangle has $n=7$ and inradius $r=1 / p=$ $\frac{1}{1+5 \sqrt{2}+\sqrt{65}}$ which yields the answer of $1 / r=1+5 \sqrt{2}+\sqrt{65}$. We can now verify that this is indeed
minimal over all $h$ by noting that its perimeter is greater than $17 / 2$, which is the upper bound in the case $h \geq 2$.