Let $a_n$ be a sequence such that $a_1=1$ and for each $n \geq 1$ $a_{n+1}$ is the smallest positive integer distinct from $a_1,a_2,...,a_n$ such that $\gcd(a_{n+1}a_n+1,a_i)=1$ for each $i=1,2,...,n$. How to prove that every positive integer appears in $a_n$?
This question was asked on a Brazilian constest. According to one of the contestants the official solution was flawed and the problem remains open. Is this result true?