# 1994 AIME Problems/Problem 10

## Problem

In triangle $ABC,\,$ angle $C$ is a right angle and the altitude from $C\,$ meets $\overline{AB}\,$ at $D.\,$ The lengths of the sides of $\triangle ABC\,$ are integers, $BD=29^3,\,$ and $\cos B=m/n\,$, where $m\,$ and $n\,$ are relatively prime positive integers. Find $m+n.\,$

## Solution 1

Since $\triangle ABC \sim \triangle CBD$, we have $\frac{BC}{AB} = \frac{29^3}{BC} \Longrightarrow BC^2 = 29^3 AB$. It follows that $29^2 | BC$ and $29 | AB$, so $BC$ and $AB$ are in the form $29^2 a$ and $29 a^2$, respectively.

By the Pythagorean Theorem, we find that $AC^2 + BC^2 = AB^2 \Longrightarrow (29^2a)^2 + AC^2 = (29 a^2)^2$, so $29a | AC$. Letting $b = AC / 29a$, we obtain after dividing through by $(29a)^2$, $29^2 = a^2 - b^2 = (a-b)(a+b)$. As $a,b \in \mathbb{Z}$, the pairs of factors of $29^2$ are $(1,29^2)(29,29)$; clearly $b = \frac{AC}{29a} \neq 0$, so $a-b = 1, a+b= 29^2$. Then, $a = \frac{1+29^2}{2} = 421$.

Thus, $\cos B = \frac{BC}{AB} = \frac{29^2 a}{29a^2} = \frac{29}{421}$, and $m+n = \boxed{450}$.

## Solution 2

We will solve for $\cos B$ using $\triangle CBD$, which gives us $\cos B = \frac{29^3}{BC}$. By the Pythagorean Theorem on $\triangle CBD$, we have $BC^2 - DC^2 = (BC + DC)(BC - DC) = 29^6$. Trying out factors of $29^6$, we can either guess and check or just guess to find that $BC + DC = 29^4$ and $BC - DC = 29^2$ (The other pairs give answers over 999). Adding these, we have $2BC = 29^4 + 29^2$ and $\frac{29^3}{BC} = \frac{2*29^3}{29^2 (29^2 +1)} = \frac{58}{842} = \frac{29}{421}$, and our answer is $\boxed{450}$.