![]()
References and digits of Pi:
The May 6, 1993 episode of The Simpsons has the character Apu boast "I can recite pi to 40,000 places. The last digit is one." See the 40000 digits above, where the 40000th one is red. (A colleague of Borwein actually supplied this information to the Simpson's program: see "Life of Pi on slides" above.) The most interesting decimal run in pi starts in position 762 (row 7, column 7), where 9999998 occurs (six nines in a row). The number two times pi has "...399999997..." (seven nines) at the same place. Expressions giving an approximation of pi: pi from an expression.
C program giving 15000 digits of pi:
This is called a spigot algorithm because it spits out digits as if from a spigot. Other versions of this program can be found on the Internet. Still, with this method one has to commit ahead of time to a specific number of digits to calculate. The next method doesn't have this weakness.
Calculating arbitrarily many digits of pi:
Calculating Pi using a simple series:
pi has commonly been calculated using arc tan formulas, as shown in: Calculating Pi using another series:
Everything done for Gregory's series can be done for this one: see reciprocals of squares. In particular, I discovered the following formula (without proof) that I haven't seen elsewhere:
Here the coefficients in the numerators above (leaving off the first 1): 1, 1, 3, 17, 155, 2073, 38227, 929569, ... are called Genocchi numbers (after an Italian mathematician).
Calculating Pi using the Arithmetic-Geometric mean:
# Here is the actual run: # Prec: 70 , iters: 4 # 3.141592653589793238462643383279502884197114678283648921556617106976027 # # pi: 3.141592653589793238462643383279502884197169399375105820974944592307816 # 1 2 3 4 5 6 7 # 1234567890123456789012345678901234567890123456789012345678901234567890Here is a summary of results of the first 13 iterations, which gives more than 40,000 digits of Pi. Even though 40,000-digit floating point accuracy is required in the calculations, only relatively few operation (a hundred or so) are needed. This method is far faster than others in this writeup. The 40,000 digits of Pie are obtained on my ancient PC with no noticable delay. # summary results for successive values of N # col 1: the value of N in the program # col 2: actual num of correct digits produced each time # col 3: = 2 times col2: expected correct digits next time # col 4: extra correct digits actually produced next time # (very slightly more than doubling each time) # 1 2 4 3 # 2 7 14 4 # 3 18 36 4 # 4 40 80 3 (this is the actual run above) # 5 83 166 4 # 6 170 340 4 # 7 344 688 5 # 8 693 1386 5 # 9 1391 2782 5 # 10 2787 5574 7 # 11 5581 11162 8 # 12 11170 22340 7 # 13 22347 > 40000 A BIT QUICKER THAN DOUBLING
Revision date: 2023-11-03. (Use ISO 8601, an International Standard.) |