Let $p> 3$ be a prime number. Determine the number of all ordered sixes $(a, b, c, d, e, f)$ of positive integers whose sum is $3p$ and all fractions $\frac{a + b}{c + d},\frac{b + c}{d + e},\frac{c + d}{e + f},\frac{d + e}{f + a},\frac{e + f}{a + b}$ have integer values.
Problem
Source: Czech and Slovak Olympiad 2016, National Round, III A p1
Tags: number theory, Integers, Sum, Fractions
06.06.2021 18:00
Let $\frac{a + b}{c + d}=x \in \mathbb{N}$, $\frac{c + d}{e + f}=y \in \mathbb{N}$, $\frac{e + f}{a + b}=z \in \mathbb{N}$. Then: $$xyz=\frac{a + b}{c + d} \cdot \frac{c + d}{e + f} \cdot \frac{e + f}{a + b}=1 \Longrightarrow$$$$x=y=z=1$$This gives that $a+b=c+d=e+f=p$. Let $\frac{b + c}{d + e}=m \in \mathbb{N}$, $\frac{d + e}{f + a}=n \in \mathbb{N}$. Then: $$mn+n+1=\frac{b + c}{d + e} \cdot \frac{d + e}{f + a}+\frac{d + e}{f + a}+1 \Longleftrightarrow$$$$mn+n+1=\frac{3p}{f+a}$$Then, since $f+a \geq 1+1=2$ and $mn+n+1>1$, we have two cases: If $f+a=p$, then $mn+n+1=3$ and since $m, n$ are positive integers, we must have $m=n=1$. Hence $b+c=d+e=f+a=p$, which gives $a+b=b+c$, $e+f=b+a$, $b+c=c+d$, $d+e=e+f$. So $a=c=e$ and $b=d=f$. Now, note that all 6-tuples of the form $(a,b,c,d,e,f)=(k,p-k,k,p-k,k,p-k)$ where $k$ is a positive integer with $k<p$ satisfy the given conditions. In conclusion, from this case, we have $p-1$ such 6-tuples. If $f+a=3$, then we have either $f=1$ and $a=2$ or $f=2$ and $a=1$. If $f=1$ and $a=2$, we have that $e=p-1$ and that $b=p-2$. In addition: $$d+e \mid b+c \Longleftrightarrow$$$$d+p-1 \mid p-2+c-d-(p-1) \Longleftrightarrow$$$$d+p-1 \mid c-d-1$$If $c-d-1 \neq 0$, we must have $d+p-1 \leq |c-d-1|$. But $d+p-1 \geq 1+p-1=p$ and $|c-d-1|=|p-d-d-1|=|p-2d-1| \leq |p-2(p-1)-1|=p-1$, contradiction. Hence $c-d-1=0 \Longrightarrow$ $c=\frac{p+1}{2}$ and $d=\frac{p-1}{2}$. As a result, this subcase gives the 6-tuple $(a,b,c,d,e,f)=(2,p-2,\frac{p+1}{2},\frac{p-1}{2}, p-1,1)$. If $f=2$ and $a=1$, we get $e=p-2$ and $b=p-1$. Also: $$d+e \mid b+c \Longleftrightarrow$$$$d+p-2 \mid p-1+c-d-(p-2) \Longleftrightarrow$$$$d+p-2 \mid c-d+1$$If $c-d+1 \neq 0$, we must have $d+p-2 \leq |c-d+1|$. But $d+p-2 \geq 1+p-2=p-1$ and $|c-d+1|=|p-d-d+1|=|p-2d+1| \leq |p-2 \cdot 1+1|=p-1$. Hence, the equality case must hold, which gives $d=1$ and $c=p-1$. If $c-d+1 = 0$, we have $c=\frac{p-1}{2}$ and $d=\frac{p+1}{2}$. This subcase gives the 6-tuples $(a,b,c,d,e,f)=(1,p-1,p-1,1, p-2,2), (1,p-1,\frac{p-1}{2},\frac{p+1}{2}, p-2,2)$ All in all, the requested number is $p-1+1+2=p+2$.