Is there a function that produces the decimals of π?

102 Views Asked by At

Is there any function Ψ defined for all n ∈ ℕ such that Ψ(n) yields the nth decimal of π? Can such a function exist? How about for any irrational number?

2

There are 2 best solutions below

0
On BEST ANSWER

Yes, there is such a function, and as comments indicated, you gave enough definition to uniquely chracterize the function, so there it is.

The function is even computable (which is not required for a function to exist). One way to compute it: simply compute $\pi$ to sufficiently many digits, then extract the one you need.

But I guess that's not what you meant. You probably wanted a simple formula or algorithm to compute one digit without computing all the preceding ones. The Wikipedia article on Pi has a section on spigot algorithms dealing with this. According to that, the BBP algorithm and its derivatives can do so in hexadecimal, which can easily be adopted to other power-of-two number systems, but “no digit extraction algorithm has yet been found that rapidly produces decimal digits”. But a footnote there clarifies that Plouffe did find a decimal function, it's just slower than computing all the digits first. There is more detail in the section on digit extraction methods in the article on the computation of $\pi$.

2
On

Yes, and you can do so for any $x \in [0, 1)$. Let \begin{align*} \psi (1) & = \lfloor 10 x \rfloor, \\ \psi(k + 1) & = \left\lfloor 10^{k + 1} x - \sum_{j = 1}^{k} 10^{k + 1 - j} \psi(j) \right\rfloor, \end{align*} where $\lfloor t \rfloor$ is the greatest integer $\leq t$. This is just the standard algorithm for finding the decimal expansion of $x$.