In the right-angled triangle $ABC$, the median to the leg $AC$ is perpendicular to the median to the hypotenuse $AB$. Express the length of the median to $AC$ as a function of $BC = a$.

---

Translate the above text into English, please retain the original text's line breaks and format, and output the translation result directly.
Let the centroid of triangle $ABC$ be $S$, and the midpoint of the leg $AC$ be $F$. Since the centroid of a triangle trisects the medians, we have

$$
BS = 2SF, \quad \text{that is} \quad BS = \frac{2}{3} BF
$$

$1986-03-118-3 . e p s$

According to the condition, the segment $CS$ is perpendicular to the segment $BF$, so the angles of triangles $BCF$ and $BSC$ are equal, which means the two triangles are similar. Therefore, the ratios of the corresponding sides in the two triangles are equal, that is

$$
\frac{BF}{BC} = \frac{BC}{BS} = \frac{3BC}{2BF}
$$

After rearrangement, $BF^2 = \frac{3}{2} BC^2$, from which

$$
BF = \sqrt{\frac{3}{2}} a
$$

A triangle $ABC$ that satisfies the given conditions exists, with sides $BC = a$, $AC = a \sqrt{2}$, and $AB = a \sqrt{3}$. This solves the problem.

Remark. Such a triangle is determined by the vertices $A, B, C$ of a cube, where $A$ and $B$ are endpoints of a space diagonal and $C$ is adjacent to $B$.