Nth digit of PI

Kirby Urner urner at alumni.princeton.edu
Mon Jun 5 15:34:50 EDT 2000


Here's another "math through programming" challenge:

Recent number theory breakthrough:  you can get the
nth digit of PI without doing all the work needed 
to compute all the digits up to the nth digit (same
with some other numbers -- not sure if we know all
the relevant criteria as to which).

The original algorithm worked for PI expressed as 
a hexadecimal number, but I found a web page purporting
to give the algorithm for a base 10 PI, but I couldn't
figure out how to make it work in Python.[1][2]

Anyone?

Another question:  does the algorithm for getting 
the nth digit of PI actually do less work (in terms
of flipflops) than would an algorithm that gets 
all digits up to n inclusive?  I assume so, as I 
read about someone getting a trillionth digit or
something -- but I don't think we've got PI to that
many places.

Kirby

[1] http://www.mathsoft.com/asolve/plouffe/plouffe.html
[2] http://www.lacim.uqam.ca/plouffe/Simon/articlepi.html





More information about the Python-list mailing list