TITLE: Math Olympiads: GCD of terms in a sequence equals GCD of their indices.
QUESTION [6 upvotes]: The sequence $a_1 ,a_2 ,a_3 ,...$ of positive integers satisfies $\text{gcd}(a_i ,a_j ) = \text{gcd} (i, j)$ for $i \neq j$. Prove that $a_i = i$ for all $i$.
Source:
Russian Mathematical Olympiad, 1995.
Are there any simple solutions to this problem that you can suggest?

REPLY [4 votes]: Let $a_i=j$. Then, $i=\gcd(i,2i)=\gcd(a_i,a_{2i})=\gcd(j,a_{2i})$, so $i|j$, i.e. $i|a_i$, for all $i$. 
Again, let $a_i=j$; from above $i|j$. But also $\gcd(i,j)=\gcd(a_i,a_j)=\gcd(j,a_j)=j$, so $j|i$. Hence, $i=j=a_i$ for all $i$. 
Actually the last line can be shortened to: Again, let $a_i=j$. Then, $i=\gcd(i,a_i)=\gcd(i,j)=\gcd(a_i,a_j)=\gcd(j,a_j)=j$.