Solution (source code)

= Solution

Each independent proposal is accepted with probability $1/M$. The number of proposals is therefore a <geometric distribution> with mean
$$
\boxed{M=\sqrt{\frac{2e}{\pi}}}.
$$