Is there a primitive recursive function which gives the nth digit of $\pi$, despite the table-maker's dilemma?

It was proved by K. Mahler (see also here or here for better bounds), that

$$\left|\pi - \frac{p}{q}\right| \geq q^{-42}$$

for any integers $p,q \geq 2$. Thus, there is a limit to how long the string of $9$'s or zeros can be. In other words, using the V. Kh. Salikhov's bound, any $m \geq 8n$ would suffice.

I hope this helps $\ddot\smile$


If we simply want the function to be computable (i.e. "recursive" in the jargon of computability theory), this is not a problem. We have a modulus of convergence for a series for $\pi$, so we know an error bound on each partial sum, with those error bounds going to zero. In effect, we have a computable sequence of nested rational intervals, whose intersection is just $\pi$.

So, if we simply compute better and better approximations, because $\pi$ is irrational we will eventually see that $\pi$ is greater than, or less than, any particular rational number $r$, because $r$ will eventually fall outside one of the intervals in our sequence.

Because finite decimal expansions give rational numbers, this means we can pin down the precise decimal expansion by repeatedly finding the next digit in this way.

However, this process is not obviously primitive recursive, because there is no bound on how small the interval will need to be before it excludes our target rational $r$. This is exactly the issue mentioned in the question, where a long string of $9$s in an approximation could eventually cause a change in a much earlier digit of the expansion. The algorithm I just mentioned uses an unbounded search to find an interval that excludes $r$, while primitive recursive methods are not generally able to perform unbounded searches.

In general, if we look at numbers other than $\pi$, it is not clear at all that we could convert an arbitrary Cauchy sequence of rationals with a given modulus of convergence into a decimal expansion via a single primitive recursive process.

So, if the decimal expansion of $\pi$ is indeed primitive recursive, some other method, or some additional (nontrivial) information about the number $\pi$ or the sequence of approximations will be necessary.