What values of $n$ is $A=\frac{a_1}{a_2}+\frac{a_2}{a_3}+\cdots +\frac{a_{n-1}}{a_n}+\frac{a_n}{a_1}$ an integer

divisibilityelementary-number-theorynumber theory

Suppose $a_i\in \mathbb{N} $ such that $a_i\ne a_j$ and $\displaystyle\frac{a_i}{a_{i+1}}\ne \frac{a_j}{a_{j+1}}~$ for $i \ne j$ $($take $a_{n+1}=a_1)$ and $\displaystyle A=\frac{a_1}{a_2}+\frac{a_2}{a_3}+\cdots +\frac{a_{n-1}}{a_n}+\frac{a_n}{a_1}$.
Then for what values of $n\ge 2$ can $A$ be an integer?

I found that if $a_i=(n-1)^i$ then $A$ is a integer but I realised that this violates the condition $\displaystyle\frac{a_i}{a_{i+1}}\ne \frac{a_j}{a_{j+1}}~$. It was easy to prove that $A$ is not an integer for $n=2$, but I was stuck for the cases where for $n>2$. I then I plugged in some values for $a_i$ but for $n>2$ but I found no solution.

Intuitively I think there is no solution but I am unable to prove it. Any help would be appreciated.

Edit-1: As pointed out by @WillJagy it is possible for $n=3,4,5$. So can we actually prove it is true for $n>6$ or are there some $n>6$ for which it isn't true?

Edit-2: I was able to find a solution for $n=5$ from a solution for $n=4$.
$$~~~~~~~~~~\frac{6}{4} + \frac{4}{3} + \frac{3}{1} + \frac{1}{6} = 6$$
$$\implies \frac{2}{4} + \frac{4}{3} + \frac{3}{1} + \frac{1}{6} = 5$$
$$\implies \frac{6}{2} +\frac{2}{4} + \frac{4}{3} + \frac{3}{1} + \frac{1}{6} = 8$$
But I could not find a solution for $n=6$ from a solution for $n=5$ because when I rewrite $\frac{4}{3} =1+\frac{1}{3}$, the $1$ in the numerator of $\frac{1}{3}$ is used by another $a_i$. I don't know whether we can prove by induction. Any suggestions is welcome.

Best Answer

$$ \frac{81}{2} + \frac{36}{81} + \frac{2}{36} = 41 $$

$$ \frac{98}{12} + \frac{63}{98} + \frac{12}{63} = 9 $$

$$ \frac{6}{4} + \frac{4}{3} + \frac{3}{1} + \frac{1}{6} = 6 $$

$$ \frac{6}{5} + \frac{5}{3} + \frac{3}{10} + \frac{10}{12} + \frac{12}{6} = 6 $$

$$ \frac{3}{12} + \frac{12}{9} + \frac{9}{10} + \frac{10}{8} + \frac{8}{5} + \frac{5}{3} = 7 $$

$$ \frac{2}{8} + \frac{8}{10} + \frac{10}{6} + \frac{6}{5} + \frac{5}{4} + \frac{4}{3} + \frac{3}{2}= 8 $$

Related Question