Admitting that you know the error function, you are looking for $a$ such that
$$\frac{1}{2}-\frac{1}{2} \text{erf}\left(\frac{a}{\sqrt{2}}\right) < 10^{-n}$$that is to say
$$\text{erf}\left(\frac{a}{\sqrt{2}}\right)> 1-2\times 10^{-n}$$
When $a$ is large
$$\text{erf}\left(\frac{a}{\sqrt{2}}\right)=1-e^{-\frac{a^2}{2}} \left(\frac{\sqrt{\frac{2}{\pi
}}}{a}+O\left(\frac{1}{a^3}\right)\right)$$ and then we search for $a$ such that
$$e^{-\frac{a^2}{2}} < \sqrt{2\pi}\, 10^{-n}\, a$$ The solution of the equation is given in terms of Lambert function
$$a=\sqrt{W\left(\frac{10^{2n}}{2\pi}\right)}$$
Some results
$$\left(
\begin{array}{ccc}
n & \text{estimate} & \text{solution} \\
1 & 1.43165 & 1.28155 \\
2 & 2.37533 & 2.32635 \\
3 & 3.11528 & 3.09023 \\
4 & 3.73464 & 3.71902 \\
5 & 4.27575 & 4.26489 \\
6 & 4.76151 & 4.75342 \\
7 & 5.20565 & 5.19934 \\
8 & 5.61710 & 5.61200 \\
9 & 6.00204 & 5.99781 \\
10 & 6.36492 & 6.36134 \\
11 & 6.70910 & 6.70602 \\
12 & 7.03717 & 7.03449 \\
13 & 7.35116 & 7.34882 \\
14 & 7.65274 & 7.65056 \\
15 & 7.94324 & 7.94324
\end{array}
\right)$$
Playing with the inverse error function, we could also have, as an approximation,
$$a=\sqrt{\log \left(\frac{2}{\pi t^2}\right)-\log \left(\log \left(\frac{2}{\pi
t^2}\right)\right)}\quad \text{where} \qquad t=2\times 10^{-n}$$ which looks to be slightly better.
$$\left(
\begin{array}{ccc}
n & \text{estimate} & \text{solution} \\
1 & 1.32266 & 1.28155 \\
2 & 2.31834 & 2.32635 \\
3 & 3.08133 & 3.09023 \\
4 & 3.71139 & 3.71902 \\
5 & 4.25847 & 4.26489 \\
6 & 4.74795 & 4.75342 \\
7 & 5.19461 & 5.19934 \\
8 & 5.60785 & 5.61200 \\
9 & 5.99413 & 5.99781 \\
10 & 6.35805 & 6.36134 \\
11 & 6.70305 & 6.70602 \\
12 & 7.03178 & 7.03449 \\
13 & 7.34632 & 7.34882 \\
14 & 7.64835 & 7.65056 \\
15 & 7.93923 & 7.94324
\end{array}
\right)$$
Now, if you need better, I think that the only solution would be given by a couple of iterations of Newton method.
scipy.special.erfcin scipy). See also numerical approximations in the linked wikipedia article. Finally, it is interesting to note that the task is doable for distributions other than normal using the concentration inequalities. Chernoff's bound is particularly useful since it bounds the tails by an expression exponential in the distance from the mean. – Adam Zalcman Oct 21 '21 at 18:22