Series where each term is square of previous
As you say, the fine on day $n$ is $2^{2^n-1}$. To reach $D$, you need to solve the equation $2^{2^n-1}=D$, taking $\log$ we have $2^n-1=\log D$, rearranging and taking $\log$ again we get $n=\log(\log D+1)$.

If you want the answers in Big-O notation, you have $2^{2^n-1} =O(2^{2^n})$, and for the second part, $n=O(\log\log D)$.