Cut the knot: learn to enjoy mathematics
A math books store at a unique math study site. Shopping at the store helps maintain the site. Thank you.
Learning Math Online
Sites for teachers
Sites for parents
Terms of use
Awards
Interactive Activities

CTK Exchange
CTK Wiki Math
CTK Insights - a blog
Math Help

III Millennium Olympiad

Games & Puzzles
What Is What
Arithmetic/Algebra
Geometry
Probability
Outline Mathematics
Make an Identity
Book Reviews
Stories for Young
Eye Opener
Analog Gadgets
Inventor's Paradox
Did you know?...
Proofs
Math as Language
Things Impossible
Visual Illusions
My Logo
Math Poll
Cut The Knot!
MSET99 Talk
Other Math sites
Front Page
Movie shortcuts
Personal info
Privacy Policy

Guest book
News sites

Recommend this site

Games to relax

Sites for teachers
Sites for parents

Education & Parenting

Manifesto  |  Bookstore  |  Contents  |  Amazon store  |  Term index  |  What changed?  |  Contact  |  Recommend
RSS Feed: Recent changes at CTK

Calculation of the Digits of π
by the Spigot Algorithm
of Rabinowitz and Wagon
(Faster Version)

The spigot algorithm of Rabinovitz 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 Rabinovitz 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 ...= 0 + 1/10000 (3141 + 1/10000 (5926 + 1/10000 (5358 + 1/10000 (9793 + 1/10000 ( ... ))))).

(The applet implements the algorithm as it is described by Arndt and Haenel with a 50,000 limitation on the number of decimal digits.)

 

This applet requires Sun's Java VM 2 which your browser may perceive as a popup. Which it is not. If you want to see the applet work, visit Sun's website at http://www.java.com/en/download/index.jsp, download and install Java VM and enjoy the applet.


Buy this applet
What if applet does not run?

References

  1. S. Rabinowitz, S. Wagon, A Spigot Algorithm for the Digits of π, The American Mathematical Monthly, Vol. 102, No. 3. (Mar., 1995), pp. 195-203.
  2. J. Arndt, C. Haenel, π Unleashed, Springer, 2000

Copyright © 1996-2009 Alexander Bogomolny

34222177Page copy protected against web site content infringement by Copyscape


Search:
Keywords:

Google
Web CTK