1. Let $p>3$ be a given prime number. Determine the number of all ordered sextuples $(a, b, c, d, e, f)$ of positive integers whose sum is equal to $3 p$, and such that all the fractions

$$
\frac{a+b}{c+d}, \quad \frac{b+c}{d+e}, \quad \frac{c+d}{e+f}, \quad \frac{d+e}{f+a}, \quad \frac{e+f}{a+b}
$$

have integer values.

(Jaromír Šimša, Jaroslav Švrček)
Solution. From the product of the 1st, 3rd, and 5th fractions, we see that their values equal 1, so we have

$$
a+b=c+d=e+f=p .
$$

From the form of the 2nd and 4th fractions, it follows that

$$
f+a \mid d+e \quad \text { and } \quad d+e \mid b+c \text {. }
$$

From this, it follows that $f+a$ is not greater than the arithmetic mean of its multiples,

$$
f+a \leqq \frac{1}{3}((f+a)+(d+e)+(b+c))=p,
$$

and simultaneously

$$
f+a \mid(f+a)+(d+e)+(b+c)=3 p .
$$

The number $f+a$ is thus a divisor of the number $3 p$ and lies in the interval $\langle 2, p\rangle$. Therefore, $f+a=p$ or $f+a=3$. We will examine both cases separately.

(i) Let $f+a=p$. Considering (3), we have $f+a=d+e=b+c=p$, which together with (1) gives $p-1$ solutions of the form

$$
(a, b, c, d, e, f)=(a, p-a, a, p-a, a, p-a), \quad \text { where } a \in\{1,2, \ldots, p-1\}
$$

(ii) Let $f+a=3$. In this case, $\{a, f\}=\{1,2\}$.

First, let $a=1$ and $f=2$. According to (1), then $b=p-1$ and $e=p-2$ and the relations (2) have the form

$$
3 \mid d+(p-2) \quad \text { and } \quad d+(p-2) \mid(p-1)+c .
$$

When analyzing (4), we distinguish whether $d=1$ or $d \geqq 2$.

For $d=1$, $c=p-1$ and the relations (4) in this case have the form

$$
3 \mid p-1 \quad \text { and } \quad p-1 \mid 2(p-1) .
$$

While the right relation always holds, the left relation is satisfied only by prime numbers $p$ of the form $p=3 q+1$ (where $q$ is a suitable natural number). For such prime numbers, we get the solution using (1)

$$
(a, b, c, d, e, f)=(1, p-1, p-1,1, p-2,2) .
$$

For $d \geqq 2$, we first show that the right relation in (4) is satisfied if and only if $d+(p-2)=(p-1)+c$ or $d=c+1$. From the relation $d \geqq 2$, it follows that $c=p-d \leqq p-2$, and thus the number $(p-1)+c$ cannot be a non-trivial multiple of the number $d+(p-2)$, because

$$
d+(p-2) \geqq p \quad \text { and } \quad(p-1)+c \leqq 2 p-33$ : For prime numbers $p$ of the form $p=3 q+1$, there exist $p+2$ sextuples and for prime numbers $p$ of the form $p=3 q+2$, there exist $p+1$ sextuples.