Problem

Source: 2004 Cuba MO 2.2

Tags: number theory, algebra, combinatorics



Write two ones, then a $2$ between them, then a $3$ between the numbers whose sum is $3$, then a $4$ between the numbers whose sum is $4$, as shown below: $$(1, 1), (1, 2, 1),(1, 3, 2, 3, 1), (1, 4, 3, 2, 3, 4, 1)$$and so on. Prove that the number of times $n$ appears, ($n\ge 2$), is equal to the number of positive integers less than $n$ and relative prime with $n$..