The points $A_{1}, A_{2}, \ldots, A_{2 n}$ are the vertices of a regular polygon with $2 n$ sides. Find the number of triples $A_{i}, A_{j}, A_{k}$ such that the triangle $A_{i} A_{j} A_{k}$ is a right triangle and the number of triples such that the triangle is acute.

## Solution.



Translate the above text into English, please keep the original text's line breaks and format, and output the translation result directly.
Since $2n$ is even, we can form right-angled triangles that will have the hypotenuse on the $n$ diameters of the polygon. For each fixed diameter, the right angle of the right-angled triangle can be any of the $2n-2$ remaining vertices. In total, there will be $R_{n} = n(2n-2) = 2n(n-1)$ right-angled triangles.

To calculate the acute triangles, we can now calculate the obtuse triangles and subtract from the total. Observe that any obtuse triangle will leave the center $O$ (its circumcenter) outside of it. If we rotate it in a direct or inverse direction around $O$, we can achieve that one of its acute vertices is at $A_{1}$. The other two are either in the set $\left\{A_{2}, \ldots, A_{n}\right\}$ or in $\left\{A_{n+2}, \ldots, A_{2n}\right\}$. The number we are looking for is $2\left(\begin{array}{c}n-1 \\ 2\end{array}\right)$. Since this can be done with each of the $2n$ vertices, there will be $2(2n)\left(\begin{array}{c}n-1 \\ 2\end{array}\right)$ triangles. But each triangle has been counted twice, once for each acute vertex.

Thus, the number of obtuse triangles will be $O_{n} = 2n\left(\begin{array}{c}n-1 \\ 2\end{array}\right)$.

The number of acute triangles will be the total number $\left(\begin{array}{c}2n \\ 3\end{array}\right)$ minus the right-angled and obtuse triangles.

$$
A_{n} = \left(\begin{array}{c}2n \\ 3\end{array}\right) - R_{n} - O_{n} = \cdots \text{ calculating } \cdots = \frac{n(n-1)(n-2)}{3} = 2\left(\begin{array}{l}n \\ 3\end{array}\right)
$$

Alternative solution. Fix an acute vertex at a vertex of the polygon, for example, at $A_{1}$. The three sides of the triangle will cover $x, y$, and $z$ sides of the $2n$-sided polygon. It will be $x + y + z = 2n$. Since all three angles are acute, it must be $0 < x, y, z < n$. Calculate the number of positive integer solutions of the equation $x + y + z = 2n$ with the fixed condition for $z$.

If $z = 1$, it leaves $x + y = 2n - 1$ which has no solutions. If $z = 2$, it leaves $x + y = 2n - 2$ which has 1 solution. If $z = 3$, it leaves $x + y = 2n - 3$ which has 2 solutions. Etc. If $z = n - 1$, it leaves $x + y = n + 1$ which has $n - 2$ solutions.

In total, there are $(n-2) + \cdots + 2 + 1 = \frac{(n-2)(n-1)}{2} = \left(\begin{array}{c}n-1 \\ 2\end{array}\right)$ solutions with one angle at $A_{1}$. If we consider the other possible positions for this angle, there are in total $2n\left(\begin{array}{c}n-1 \\ 2\end{array}\right)$. But we have counted each triangle three times, so it remains

$$
A_{n} = \frac{n(n-1)(n-2)}{3} = 2\left(\begin{array}{l}n \\ 3\end{array}\right)
$$