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.
Possibly to generate a sequence of 0 and 1 (firstly find an upper bound for the number of digits) and do something with the extra (too long) decimal numbers. What to do depends on the distribution. The easiest way is to try again, but it can be non-effective in some cases.