Inductively, $a_n$ tells us the index of the ticket selected from the reordered stack $n, 1, 2, \ldots, (n-1)$ to determine $a_{n+1}$. So $$a_n = \begin{cases} 1 & \textrm{if } n = 1 \\ n-1 & \textrm{if }a_{n-1} = 1 \\ a_{n-1} - 1 & \textrm{otherwise} \end{cases} \tag{1}$$
Then for $1 \le k \le 2^n$, $$a_{2^n + k} = 2^n + 1 - k \tag{2}$$
Proof of $(2)$ by induction on $n$: the base case is $n=0$ where the only value of $k$ is $1$ and we do indeed have $a_2 = 1$. For the inductive step, we assume it holds for $n-1$. Then $a_{2^n} = 1$, so $a_{2^n+1} = 2^n$ by $(1)$, and $(2)$ holds for $k=1$. Then by induction on $k$ using $(1)$, $(2)$ continues to hold until $k=2^n$, where we have $a_{2^{n+1}} = 1$.