Question: What is the most practical procedure to generate a random (decimal) $n$-digit integer using a coin?

By "the most practical procedure" I mean a procedure that is quick and as simple and easy to carry out *in real life* as possible.

There is [another question I asked](https://math.stackexchange.com/questions/2021717/generate-a-number-with-a-die-that-has-three-0s-and-three-1s) that is more general and abstract. This time, I feel that the answer is going to be completely different, and again – after hours of thinking, I haven't been able to come up with a solution. Googling doesn't yield a satisfactory answer, either.

Answer: 
Roll the dice $4n$ times, form a binary integer with the outcomes and multiply it by $10^n/2^{4n}$.

There will be a little bias on the distribution of the last digit, I guess. You can reduce it using more than $4n$ drawings.

---

The now deleted suggestion by @5xum is better. Generate an $m$ bit binary number and retry if it exceeds $10^n-1$. For efficiency, take the smallest $m$ that fits,

$$m=\left\lceil n\frac{\log10}{\log2}\right\rceil.$$

On average you will need $m$ drawings times the average number of attempts, equal to $1/(1-p)$ where $p$ is the probability of exceeding $10^n-1$ (this is a geometric law).

As $$p=1-\frac{10^m}{2^n},$$ generating a number takes

$$\frac{m2^m}{10^n}$$ drawings.

For instance, with $n=8$, $m=27$ we have $p=0.255$ and close to $36.24$ drawings ($4.53$ per digit).

---

I guess that you can avoid the retries (hence achieve the optimal $\log10/\log2\approx3.322$ drawings per digit on average) by considering a very long sequence of $km$ bits and converting it to base $10^n$ (giving $kn$ digits). I wouldn't be surprised that this can be implemented by storing the last $m$ generated bits only.
This isn't very efficient, but a simple way to do this would be to assign each decimal digit to a unique string of heads and tails of length 4 (for example, 0=HHHH, 1=HHHT, 2=HHTH, etc.). Then, to generate each digit, flip the coin 4 times. If the result does not correspond to a digit, flip the coin another 4 times, and repeat until the result is achieved. This takes $1.6 \cdot 4 = 6.4$ flips to generate each digit on average.