TOPICS
Search

Digit-Extraction Algorithm


A digit-extraction algorithm allows digits of a given number to be calculated without requiring the computation of earlier digits. The BBP formula for pi is the best-known such algorithm, but an algorithm also exists for e.

Plouffe (2022) proposes a formula for decimal digits of pi by defining

 pi_n=((2(-1)^(n+1)(2n)!)/(2^(2n)B_(2n)(1-2^(-2n))(1-3^(-2n))(1-5^(-2n))(1-7^(-2n))))^(1/(2n)).
(1)

A candidate for the nth digit to the right of the decimal point of pi for n>=3 is

 d_n=int(10frac(10^(n-1)pi_(n-1))),
(2)

where int(x) is the integer part and frac(x) is the fractional part. To certify the digit, an error bound must exclude crossing a decimal truncation boundary. A small absolute error alone does not guarantee this. Similar approximations can be obtained using

 lim_(n->infty)((2^(2n+2)(-1)^n(2n)!)/(E_(2n)))^(1/(2n+1))=pi
(3)

and

 lim_(n->infty)((2^(2n+2)(-1)^n(2n)!)/(E_(2n))(1-1/(3^(2n+1))))^(1/(2n+1))=pi,
(4)

where E_n is an Euler number (Plouffe 2022). Plouffe uses the first approximation for octal (base 8) digits and the second for decimal digits, subject to the same truncation-boundary requirement. Related limits and formulas can also be obtained for pi^2 (Plouffe 2022).


See also

BBP Formula, Pi Digits, Pi Formulas

Explore with Wolfram|Alpha

References

Plouffe, S. "A Formula for the n'th Decimal Digit or Binary of pi and pi^n." 29 Jan 2022. https://arxiv.org/abs/2201.12601.

Referenced on Wolfram|Alpha

Digit-Extraction Algorithm

Cite this as:

Weisstein, Eric W. "Digit-Extraction Algorithm." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/Digit-ExtractionAlgorithm.html

Subject classifications