Computation of the n’th digit of pi in any base in O(n^2) (1997)

Fabrice Bellard presents an algorithm to compute the n’th digit of a mathematical constant in any base with minimal memory requirements. This algorithm is an improvement on a previous one by Simon Plouffe and has a running time of O(n log n), making it practical to compute the millionth digit of the constant. The algorithm works by utilizing the Chinese remainder theorem and computing each term separately, using a total memory of O(log n). The article also discusses the application of the algorithm to compute other numbers like pi, arctangent, and e. Although slower than the BBP algorithm, Bellard’s algorithm is simple, low memory, and works in any base.

https://bellard.org/pi/pi_n2/pi_n2.html

To top