Computing the digits of e

Posted on

I discovered only recently about Google’s challenge to find the first ten-digit prime number in the consecutive digits of e. For fun, I solved the challenge (and the follow-up challenge), but the interesting part is a cool algorithm that I came across to compute the digits of e, one by one.

The algorithm lets you compute the digits sequentially without any pre-commitment to the total number of digits you’ll eventually take. The technique behind the algorithm can be used to compute other things, and so it’s worth a look.

If you’re interested, please take a look at my HuSi diary entry on the subject, Google challenge task and computing the digits of e, where I explain the method in detail. I’ll also refer you to Jeremy Gibbons’s paper An Unbounded Spigot Algorithm for the Digits of Pi, which is the inspiration for the method.

comments powered by Disqus