Question 23
Let $a_1,a_2,a_3,a_4,\ldots$ be the sequence formed by adding the numbers in all the possible nonempty finite subsets of $\{3^0,3^1,3^2,3^3,\ldots\}$, and are arranged as a monotone increasing sequence. Thus, $a_1=1(=3^0)$, $a_2=3(=3^1)$, $a_3=4(=3^0+3^1)$, $a_4=9(=3^2)$, $a_5=10(=3^0+3^2)$, ... and so on. Determine the value of $a_{217}$.