Calculation of the Digits of π
by the Spigot Algorithm
of Rabinowitz and Wagon
(Faster Version)
The spigot algorithm of Rabinowitz and Wagon outputs sequentially the decimal digits of π one at a time. The basic idea of the algorithm however applies to other positional system. In particular, it was noted yet by Rabinowitz and Wagon themselves that the algorithm can be sped up by using the system in base, say, 10000. The digits in such a system are groups of 4 decimal digits so that in this variant the algorithm generates 4 decimal digits at a time:
π/10 | = .314159 ... |
(The applet implements the algorithm as it is described by Arndt and Haenel with a 50,000 limitation on the number of decimal digits.)
What if applet does not run? |
References
- S. Rabinowitz, S. Wagon, A Spigot Algorithm for the Digits of π, The American Mathematical Monthly, Vol. 102, No. 3. (Mar., 1995), pp. 195-203.
- J. Arndt, C. Haenel, π Unleashed, Springer, 2000
|Activities| |Contact| |Front page| |Contents| |Algebra|
Copyright © 1996-2018 Alexander Bogomolny
71861562