Source: IMO-2013-P6
Category: Counting

Problem:
Let $n \ge 3$ be an integer, and consider a circle with $n+1$ equally spaced points marked on it. Consider all labelings of these points with the numbers $0,1,\dots ,n$ such that each label is used exactly once; two such labelings are considered to be the same if one can be obtained from the other by a rotation of the circle. A labeling is called *beautiful* if, for any four labels $a<b<c<d$ with $a+d=b+c$, the chord joining the points labelled $a$ and $d$ does not intersect the chord joining the points labelled $b$ and $c$. Let $M$ be the number of beautiful labelings, and let $N$ be the number of ordered pairs $(x,y)$ of positive integers such that $x+y\le n$ and $\gcd(x,y)=1$. Prove that $M=N+1$.

Solution:
Abbreviate “beautiful labelling of points around a circle” to *ring*. Throughout the solution, we will allow degenerate chords that join a point to itself; this has no effect on the problem statement.

The idea is to proceed by induction. Let $M_n$ be the number of rings on the labels $[0,n]$. A ring on $[0,n]$ is called *linear* if the sequence of labels forms an arithmetic progression modulo $n+1$. 

We can move from any ring on $[0,n]$ to a ring on $[0,n-1]$ by deleting the point $n$. We will prove that:
- Each linear ring on $[0,n-1]$ yields exactly two rings on $[0,n]$, and
- Each nonlinear ring on $[0,n-1]$ yields exactly one ring on $[0,n]$.

Since a linear ring on $[0,n-1]$ is generated by a common difference coprime to $n$, and we consider rings up to rotation, there are exactly $\varphi(n)$ linear rings on $[0,n-1]$. Thus, the number of linear rings is $L_{n-1} = \varphi(n)$. The recurrence for $M_n$ will then be:
\[ M_n = 2 L_{n-1} + 1 \cdot (M_{n-1} - L_{n-1}) = M_{n-1} + L_{n-1} = M_{n-1} + \varphi(n). \]

We say a set of chords (possibly degenerate) is *pseudo-parallel* if they do not cross, and for any three of them, one separates the other two. (Pictorially, one can perturb the endpoints along the circle to make them parallel in the Euclidean sense without changing their cyclic order). 

\begin{lemma*}
  In any ring, the chords of sum $k$ (including degenerate ones) are pseudo-parallel.
\end{lemma*}
\begin{proof}
  By induction on $n$. The base cases are trivial. Suppose the statement holds for rings up to maximum label $n-1$. We prove it for a ring with maximum label $n$.
  By a shifting argument—discarding all labels exceeding $k$, which preserves the beautiful property for the remaining labels—we may assume $k=n$, so that one of the chords is $\{0, n\}$.
  
  Suppose for contradiction there exist three chords of sum $n$ that are not pseudo-parallel. Without loss of generality, let one be $\{0, n\}$, and the other two be $\{a, n-a\}$ and $\{b, n-b\}$. Since they are not pseudo-parallel, none separates the other two. Thus, $\{a, n-a\}$ and $\{b, n-b\}$ must lie on the same arc bounded by $0$ and $n$ (say, the "upper" arc). Furthermore, they must be "side-by-side", meaning neither separates the other from $\{0, n\}$.
  
  Let $u$ and $v$ be the points on the upper arc immediately adjacent to $0$ and $n$, respectively. Consider the sum $u+v$. There are three cases:
  \begin{itemize}
    \item If $u+v = n$, then $\{u, v\}$ is a chord of sum $n$. Delete $0$ and $n$ and decrease all remaining labels by $1$. The chords $\{a, n-a\}$ and $\{b, n-b\}$ become $\{a-1, n-a-1\}$ and $\{b-1, n-b-1\}$, which have sum $n-2$. The chord $\{u, v\}$ becomes $\{u-1, v-1\}$, also of sum $n-2$. In the new ring, $u$ and $v$ are adjacent, so $\{u-1, v-1\}$ is an edge of the polygon and cannot separate the other two chords. Since $\{a-1, n-a-1\}$ and $\{b-1, n-b-1\}$ are side-by-side, these three chords of sum $n-2$ are mutually non-separating, contradicting the induction hypothesis.
    \item If $u+v < n$, consider the chord $\{0, u+v\}$. It has sum $u+v$, the same as $\{u, v\}$. Since the ring is beautiful, they do not intersect. This forces $u+v$ to lie on the lower arc. Then the chord $\{u+v, n-(u+v)\}$ has sum $n$, so it cannot intersect $\{0, n\}$, meaning $n-(u+v)$ is also on the lower arc. Now delete $0$ and $n$ and decrease everything by $1$. The chords $\{a-1, n-a-1\}$, $\{b-1, n-b-1\}$, and $\{u+v-1, n-(u+v)-1\}$ have sum $n-2$. The first two are on the former upper arc, and the third is on the former lower arc. In the new ring, the former lower arc connects $u$ and $v$ without crossing the former upper arc. Thus, the third chord cannot separate the first two, and neither of the first two can separate the third. This gives three mutually non-separating chords of sum $n-2$, contradicting the induction hypothesis.
    \item If $u+v > n$, apply the map $t \mapsto n-t$ to the entire ring. This preserves the beautiful property and chords of sum $n$. The upper and lower arcs are swapped, and the new points adjacent to $0$ and $n$ on the upper arc are $n-v$ and $n-u$. Their sum is $(n-v) + (n-u) = 2n - (u+v) < n$, which reduces to the previous case.
  \end{itemize}
\end{proof}

Next, we give another characterization of linear rings.
\begin{lemma*}
  A ring on $[0,n-1]$ is linear if and only if the point $0$ does not lie between two chords of sum $n$.
\end{lemma*}
\begin{proof}
  This is obviously true for linear rings. Conversely, assume the property holds for some ring. 
  Since the chords of sum $n-1$ are pseudo-parallel and encompass every point, they are linearly nested. This implies that the involution $t \mapsto n-1-t \pmod n$, which swaps the endpoints of these chords, reverses the cyclic order of the points. Thus, it acts as a geometric reflection of the circle.
  Similarly, the chords of sum $n$ encompass every point except $0$. Since $0$ does not lie between two such chords, they are linearly nested with $0$ at the boundary. The involution $t \mapsto n-t \pmod n$ swaps the endpoints of these chords and fixes $0$. Since the chords are linearly nested, this involution also reverses the cyclic order of the points, acting as another geometric reflection of the circle.
  
  The composition of these two reflections is a geometric rotation of the circle. Applying the first reflection and then the second maps the position of $t$ to $(n-1)-(n-t) \equiv t-1 \pmod n$. Since this map is a rotation, the sequence of points $0, -1, -2, \dots$ appears at equal angular intervals around the circle. Therefore, the ring is an arithmetic progression modulo $n$, which means it is linear.
\end{proof}

\begin{lemma*}
  Every nonlinear ring on $[0,n-1]$ induces exactly one ring on $[0,n]$.
\end{lemma*}
\begin{proof}
  Because the chords of sum $n$ are pseudo-parallel, they are linearly nested. Since the ring is nonlinear, $0$ lies between two chords of sum $n$, say $C_1$ and $C_2$. The region between $C_1$ and $C_2$ intersects the circle in two arcs, and $0$ lies on one of them. In order for the new chord $\{0, n\}$ to be pseudo-parallel to all chords of sum $n$, it must separate $C_1$ and $C_2$. This requires $n$ to be placed on the *other* arc bounded by $C_1$ and $C_2$. Since all points other than $0$ are endpoints of the chords of sum $n$, this other arc contains no points of the ring, and thus corresponds to exactly one interval between adjacent points. Therefore, there is at most one possibility for the location of $n$.

  Conversely, we claim that this unique placement works. The chords of sum less than $n$ do not involve $n$, so they do not intersect by the induction hypothesis. The chords of sum $n$ do not intersect by our choice of the location of $n$. Assume for contradiction that there exist two intersecting chords of sum $S > n$. Since $n$ is the maximum label, this can only happen if one chord is $\{a, b\}$ and the other is $\{n, c\}$, where $a, b, c \in \{1, \dots, n-1\}$ and $a+b = n+c$.
  
  Consider the chords of sum $n$. Because they form a pseudo-parallel perfect matching of the points, we can continuously deform the circle to make these chords geometrically parallel without changing the cyclic order of the points. In this configuration, the map $x \mapsto n-x$ is a geometric reflection. Since geometric reflection preserves the intersection of chords, $\{a, b\}$ and $\{n, c\}$ intersect if and only if their reflections $\{n-a, n-b\}$ and $\{0, n-c\}$ intersect.
  However, $(n-a) + (n-b) = 2n - (a+b) = 2n - (n+c) = n-c = 0 + (n-c)$. Thus, $\{n-a, n-b\}$ and $\{0, n-c\}$ are two chords in the original ring $[0, n-1]$ with the same sum $n-c < n$. Since the original ring is beautiful, they cannot intersect, a contradiction. Thus, the original numbers on $[0,n-1]$ together with $n$ form a beautiful ring.
\end{proof}

\begin{lemma*}
  Every linear ring on $[0,n-1]$ induces exactly two rings on $[0,n]$.
\end{lemma*}
\begin{proof}
  Because the ring is linear, $0$ does not lie between two chords of sum $n$. Thus, all chords of sum $n$ lie on one side of $0$. The region containing $0$ is bounded by a single chord of sum $n$, and the arc of this region containing $0$ has no other points. To make $\{0, n\}$ pseudo-parallel to the chords of sum $n$, $n$ must be placed in this same region. Since $0$ is the only point in this region, $n$ can be placed in exactly two locations: immediately to the left of $0$, or immediately to the right of $0$. For the same reason as the reflection argument in the previous proof, both choices yield a beautiful ring.
\end{proof}

**Conclusion:**
We are given $n \ge 3$, but we can anchor our induction at $n=2$. For $n=2$, the labels are $0, 1, 2$. Up to rotation, there are $2$ labelings: $(0, 1, 2)$ and $(0, 2, 1)$. Both are trivially beautiful, so $M_2 = 2$.
The problem defines $N$ as the number of ordered pairs $(x, y)$ of positive integers with $x+y \le n$ and $\gcd(x,y)=1$. For a fixed sum $k \in \{2, \dots, n\}$, there are exactly $\varphi(k)$ such pairs. Thus, $N_n = \sum_{k=2}^n \varphi(k)$.
For $n=2$, $N_2 = \varphi(2) = 1$, so $M_2 = N_2 + 1$.
Assume by induction that $M_{n-1} = N_{n-1} + 1$. By our lemmas, 
\[ M_n = M_{n-1} + \varphi(n) = N_{n-1} + 1 + \varphi(n) = N_n + 1. \]
This completes the proof that $M = N + 1$.


Grading guidelines:
(Partial) 1. Established the recurrence idea by deleting the point labeled n (or another maximal label) to reduce a beautiful labeling on [0,n] to one on [0,n−1], and stated/argued that M_n should satisfy M_n=M_{n-1}+“number of special (linear) rings on [0,n−1]”. 2. Proved a key structural property of beautiful rings: for a fixed sum k, the chords joining pairs {a,k−a} do not cross (e.g. form a noncrossing matching / are “nested” / pseudo-parallel). 3. Correctly counted that the number of ordered coprime pairs (x,y) with x+y=k equals φ(k), hence N=∑_{k=2}^n φ(k). (Almost) 1. Gave a full inductive solution with M_n=M_{n-1}+φ(n) by classifying rings on [0,n−1] into linear and nonlinear and proving that linear rings extend to exactly two rings on [0,n] while nonlinear rings extend to exactly one, but left a localized gap in justifying the “exactly one/two placements” of the new point n. 2. Proved the extension counts (1 for nonlinear, 2 for linear) and derived the recurrence, but did not fully justify the characterization/count of linear rings as φ(n) up to rotation (e.g. missing the coprimality argument for the step size, or the rotation-equivalence check). 3. Solution is almost complete, but made minor mistakes which are not negligible.