The increasing sequence $1,3,4,9,10,12,13\cdots$ consists of all those positive integers which are powers of 3 or sums of distinct powers of 3. Find the $100^{\mbox{th}}$ term of this sequence.
The terms are exactly the numbers whose base-three digits are $0$ and $1$. Listed in increasing order, they correspond to the binary numerals $1,10,11,100,\dots$ read in base three.
So the $100$th term is $100=1100100_2$ read in base $3$, which is $3^6+3^5+3^2=729+243+9=981$.
The increasing sequence $1,4,5,16,17,20,21,\ldots$ consists of all those positive integers which are powers of 4 or sums of distinct powers of 4. Find the $30^{\mbox{th}}$ term of this sequence.