2. Find the sides of a right triangle if they are natural numbers and the product of the legs is three times greater than the perimeter of the triangle.
Solution. Let's denote the legs by $a$ and $b$, and the hypotenuse by $c$. According to the condition in the problem, we have $ab = 3(a + b + c)$. Since $a$ and $b$ are natural numbers, it follows that 3 is a divisor of at least one of the legs. Let $a = 3x$, then $c = xb - 3x - b$ and we have

$$
(xb - 3x - b)^2 = (3x)^2 + b^2
$$

We get

$$
xb(xb - 6x - 2b + 6) = 0
$$

and from $x \neq 0$ and $b \neq 0$ it follows that

$$
xb - 6x - 2b + 6 = 0
$$

which is equivalent to

$$
(b - 6)(x - 2) = 6
$$

Therefore,

$$
\begin{gathered}
\left\{\begin{array}{l}
b - 6 = 1 \\
x - 2 = 6
\end{array},\left\{\begin{array}{l}
b - 6 = 2 \\
x - 2 = 3
\end{array},\left\{\begin{array}{l}
b - 6 = 3 \\
x - 2 = 2
\end{array},\left\{\begin{array}{l}
b - 6 = 6 \\
x - 2 = 1
\end{array}\right.\right.\right.\right. \\
\left\{\begin{array}{l}
b - 6 = -1 \\
x - 2 = -6
\end{array},\left\{\begin{array}{l}
b - 6 = -2 \\
x - 2 = -3
\end{array},\left\{\begin{array}{l}
b - 6 = -3 \\
x - 2 = -2
\end{array},\left\{\begin{array}{l}
b - 6 = -6 \\
x - 2 = -1
\end{array}\right.\right.\right.\right.
\end{gathered}
$$

Thus, there are three right-angled triangles (up to congruence) with the required properties, and their sides are: $a = 24, b = 7, c = 25$, $a = 15, b = 8, c = 17$, and $a = 12, b = 9, c = 15$.