How to verify if a given number is a decimal expansion of $\pi$?

124 Views Asked by At

Let's say I am given a number $x$ and I want to check if $x$ is a valid truncation of $\pi$, so for example 3, 3.14 or 3.1415. Is there an algorithm for this that's faster than computing the value of $\pi$ to the required accuracy (using an existing algorithm), and then comparing the digits?

For example, if somebody claimed that $x$ is approximately the golden ratio, I could always check if $x + 1 \approx x^2$ to see if they're right. Is there a similar check for $\pi$?

If checking for a trunctation is too difficult, the more laxed version would check for a good-enough approximation, so accurate to some $\pm 10^{-k}$ or something.

1

There are 1 best solutions below

1
On

Ramanujan has this formula which gives you 8 more decimal digits with each extra term.

6$$\frac{1}{\pi} = \frac{2\sqrt{2}}{9801} \sum^\infty_{k=0} \frac{(4k)!(1103+26390k)}{(k!)^4 396^{4k}}$$