I asked a question about this a while ago and it got deleted, so I've looked into it a bit more and I'll explain my problem better.
Planetmath.org told me that there is a primitive recursive function which gives the nth digit of $\pi$, but didn't prove it. When I asked before how one might prove it, a couple of people suggested using Gregory's series. Now I can see that if you know that to find the nth digit of $\pi$ you need to calculate it to within $10^{-m}$ where m is a p.r.f of n, you can define $$\lfloor{{10}^n\pi}\rfloor = \lfloor\frac{4\sum_{i=1}^{5\times10^{m-1}} \lfloor{\frac{10^{2m+1}}{2i-1}}\rfloor(-1)^{i-1}}{10^{2m+1-n}}\rfloor$$ and then you're basically there.
The problem is this: can you ever find an m such that calculating pi to accuracy $10^{-m}$ gives you the nth digit correct with probability 1? Isn't there always a small probability that the digits between the nth and the mth would be all 9 or all 0, and so you could still get the nth digit wrong, because say they were all 9, you could have calculated a number which had the nth digit one higher, say ...300000... instead of ...299999... which would still be accurate to within $10^{-m}$. In fact if as is suspected $\pi$ is normal, doesn't the sequence of n nines occur an infinite number of times for any n? This problem is called the table-maker's dilemma, but I haven't found it explicitly mentioned in this context.
So, my question is, is it the case that either a) you can't really define a primitive recursive function using an arithmetic series like this, or b) there is actually some way of finding m as a function of n. Thanks!
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$