# 2016 AIME II Problems/Problem 5

Triangle $ABC_0$ has a right angle at $C_0$. Its side lengths are pariwise relatively prime positive integers, and its perimeter is $p$. Let $C_1$ be the foot of the altitude to $\overline{AB}$, and for $n \geq 2$, let $C_n$ be the foot of the altitude to $\overline{C_{n-2}B}$ in $\triangle C_{n-2}C_{n-1}B$. The sum $\sum_{i=1}^\infty C_{n-2}C_{n-1} = 6p$. Find $p$.

## Solution

Note that by counting the area in 2 ways, the first altitude is $\dfrac{ac}{b}$. By similar triangles, the common ratio is $\dfrac{a}{c}$ for reach height, so by the geometric series formula, we have $6p=\dfrac{\dfrac{ab}{c}}{1-\dfrac{a}{c}}$. Multiplying by the denominator and expanding, the equation becomes $\dfrac{ab}{c}=6a+6b+6c-\dfrac{6a^2}{c}-\dfrac{6ab}{c}-6a$. Cancelling $6a$ and multiplying by $c$ yields $ab=6bc+6c^2-6a^2-6ab$, so $7ab = 6bc+6b^2$ and $7a=6b+6c$. Checking for Pythagorean triples gives $13,84,$ and $85$, so $p=13+84+85=\boxed{182}$