WyomingGeezer
WyomingGeezer

Reputation: 157

Calculating Pi to millions of places on a Raspberry PI

I have this odd goal: dedicate a Raspberry PI to calculating the value of Pi to millions of digits. Running 24/7, I have 496 weeks before my (statistically speaking) demise. So, researching on SO, I found this page that might be an answer to my quest. Question: can anyone point me to more information on this specific algorithm and whether or not it is valid and accurate for a gazillion digits? Or, if this dog can't hunt, point me to one that can. The algorithm must not consume large amounts of memory -- a hard drive will do that. Thoughts?

Upvotes: 1

Views: 1234

Answers (1)

Reblochon Masque
Reblochon Masque

Reputation: 36702

Here is a good paper where several algorithms are discussed and compared : http:www.cs.ox.ac.uk/jeremy.gibbons/publications/spigot.pdf

You likely want to go for an algorithm that calculates digits one by one independently. The RABINOWITZ AND WAGON’S SPIGOT ALGORITHM (presented in the paper) outputs the nth digit of pi in linear time O(n) with memory usage O(log(n)).

Upvotes: 2

Related Questions