6. Find all right-angled triangles with integer side lengths into which two identical circles with a prime radius can be inscribed, such that the circles are externally tangent to each other, both touch the hypotenuse, and each touches a different leg.

(Jaromír Šimša)
SOLUTION. We will show that the sought triangle is unique, has side lengths 21, 28, 35, and the two tangent circles have a radius equal to the prime number 5.

In any right-angled triangle $ABC$ with hypotenuse $AB$, let $a = |BC|$, $b = |AC|$, and $c = |AB|$. There certainly exist two congruent circles with all the tangencies described in the problem. Let these circles be $k_1(S_1, r)$ and $k_2(S_2, r)$ such that $k_1$ is tangent to $AC$ (and thus $k_2$ to $BC$), and let the points of tangency with $AB$ be $T_1$ and $T_2$ respectively, as shown in the figure. Consider also the incircle $k(S, \varrho)$ of triangle $ABC$ and let $D$ be the point of tangency of $k$ with $AB$.

![](https://cdn.mathpix.com/cropped/2024_04_17_cb8de399e949329b1759g-10.jpg?height=429&width=763&top_left_y=885&top_left_x=652)

In the first part of the solution, we will show that the radius $r$ of circles $k_1$ and $k_2$ is given by the equation

$$
r = \frac{c(a + b - c)}{2(a + b)}
$$

In the homothety centered at point $A$ with coefficient $r / \varrho$, which maps $k$ to $k_1$, point $D$ is mapped to point $T_1$. Thus, $|AT_1| = |AD| \cdot r / \varrho$. Similarly, we have the equation $|BT_2| = |BD| \cdot r / \varrho$. Since from the rectangle $T_1 T_2 S_2 S_1$ it follows that $|T_1 T_2| = |S_1 S_2| = 2r$, substituting into the obvious equation $c = |AT_1| + |T_1 T_2| + |BT_2|$ and considering $|AD| + |BD| = c$, we get

$$
c = |AD| \cdot \frac{r}{\varrho} + 2r + |BD| \cdot \frac{r}{\varrho} = 2r + (|AD| + |BD|) \cdot \frac{r}{\varrho} = 2r + \frac{cr}{\varrho}.
$$

From this, the expression for the radius $r$ is

$$
r = \frac{c \varrho}{c + 2 \varrho}
$$

Substituting the known formula $\varrho = (a + b - c) / 2$ and simplifying, we obtain the desired equation (1).

Now assume that the lengths $a, b, c, r$ are expressed as integers and let $k = \gcd(a, b, c)$. Then $a = k a_1$, $b = k b_1$, and $c = k c_1$, where due to the Pythagorean equality $a_1^2 + b_1^2 = c_1^2$, the numbers $a_1, b_1, c_1$ are pairwise coprime and the first two have different parities*.[^1]

The third number $c$ is thus odd, and therefore the number $a_1 + b_1 - c_1$ is even. Substituting $a = k a_1$, $b = k b_1$, and $c = k c_1$ into (1) and then canceling by $k$, we get

$$
r = \frac{k c_1 (a_1 + b_1 - c_1)}{2 (a_1 + b_1)} = \frac{k}{a_1 + b_1} \cdot c_1 \cdot \frac{a_1 + b_1 - c_1}{2}.
$$

We will prove that not only the second, but also the first fraction on the right-hand side of (2) has an integer value. If some prime number $p$ divides the odd number $a_1 + b_1$, then it cannot be that $p \mid c_1$ (and thus $\left. p \mid a_1 + b_1 - c_1 \right)$, otherwise by the equality $\left( a_1 + b_1 \right)^2 = c_1^2 + 2 a_1 b_1$ it would follow that $p \mid a_1 b_1$, which together with $p \mid a_1 + b_1$ would mean $p \mid a_1$ and $p \mid b_1$, i.e., a contradiction with the coprimality of the numbers $a_1, b_1$. The number $a_1 + b_1$ is thus coprime with both $c_1$ and $a_1 + b_1 - c_1$, and therefore, due to the integrality of $r$, the first fraction in its expression (2) is also an integer.

Only now will we add the assumption that $r$ is a prime number. This is the product of three natural numbers according to (2). Considering $c_1 > a_1 \geq 1$, it necessarily follows that $c_1 = r$ and the two fractions on the right-hand side of (2) have the value 1. Thus, the equations $k = a_1 + b_1$ and $a_1 + b_1 - c_1 = 2$ hold, or $k = a_1 + b_1 = c_1 + 2 = r + 2$. From this, it follows that

$$
2 a_1 b_1 = (a_1 + b_1)^2 - c_1^2 = (r + 2)^2 - r^2 = 4r + 4.
$$

Dividing by two, we get

$$
a_1 b_1 = 2r + 2 = 2(a_1 + b_1 - 2) + 2 = 2a_1 + 2b_1 - 2.
$$

The last equation $a_1 b_1 = 2a_1 + 2b_1 - 2$ can be rewritten as $(a_1 - 2)(b_1 - 2) = 2$. From this, it easily follows that $\{a_1, b_1\} = \{3, 4\}$, and thus $c_1 = r = a_1 + b_1 - 2 = 5$ and $k = r + 2 = 7$. For the right-angled triangle with sides $7 \cdot 3$, $7 \cdot 4$, and $7 \cdot 5$, it indeed holds that $r = 5$. This proves the statement in the initial sentence of the solution.

[^0]: * The value $\{t\}$ is commonly referred to as the fractional part of the given real number $t$.

[^1]: * The sum of the squares of two odd numbers is an even number that is not divisible by four, hence it is not a square.