Bailey-Borwein-Plouffe formula
The Bailey-Borwein-Plouffe formula (or BBP formula) allows us to calculate the nth digit of π in base 2 (or 16) without having to find the precedents, quickly and using very little memory space on the computer. Simon Plouffe along with David Bailey and Peter Borwein found this formula on September 19, 1995 using a computer program called PSLQ that looks for relationships between integers.
The BBP formula
The proof of this formula is below.
Using the formula to calculate the decimal places of the number π
The following is the calculation of the nth hexadecimal digit of π.
First note that the digit at position N+1 of π in base 16 is the same as the first hexadecimal digit of 16Nπ. Indeed, as in base 10, multiplying a number in base 16 by 16 is equivalent to moving the decimal point one place to the right. Thus, multiplying by 16N moves the comma N places to the right. The original problem reduces to computing the first digit of 16Nπ. Using the BBP formula:
Calculating the first hexadecimal digits to the right of the comma of this number is not easy for two reasons: the number is very large, and the sum is infinite.
Suppose . The calculation of the first hexadecimal digits of SN(a) to obtain 16Nπ, through the relationship:
Decompose the sum SN(a) into two:
AN(a) and BN(a) can be computed independently.
BN(a) calculation
Although this is an infinite sum, it is very easy to calculate, because its terms are small and rapidly decreasing.
- The first term of the sum is: . If the enesimo hexadecimal digito of π is sought (N = 1 000 000 000 for example), the first term is much lower than 1.
- In addition, each term has a zero more to the right of the coma than the previous one, because for k ≥ N, bk ▪ 16 bk+1:
Finally, the sum BN(a) is of the form (in the worst case):
Contenido relacionado
Peta (prefix)
Friendly numbers
Ϝ