We can focus on prime numbers to solve this puzzle. We will recursively construct our sequence $(a_n)$. Let $a_1=2, a_2=3$. Having constructed $a_n$ for $n=1,...,i$ with $i>2$, let $m$ be the maximum prime number that appears among $a_1,...,a_i$ (i.e. if we let $P$ to be the set of all prime numbers, then $m=\max\{a_j\in P:1\leq j\leq i\}$). If all positive integers less than or equal to $m-2$ appears among $a_1,...,a_i$, then let $a_{i+1}=\text{smallest prime number strictly larger than } m$.
Otherwise, let $a_{i+1}=$smallest positive integer that doesn't appear among $a_1,...,a_i$. This completes our recursive construction for the sequence $(a_n)$ with $n$ being a positive integer.
We can manually check that our constructed sequence matches with your given sequence 2,3,1,... until the 15th term. Using the rule for our recursive construction we can get that 15 should come as the 16th term.
I computed upto 20th term for convenience.
$2,3,1,5,7,4,11,6,8,9,13,10,17,12,14,15,19,16,23,18$