Hello!

Please input the number of digits of pi you want.

You can request up to 24 digits.

Here is what we did to compute pi.

There are a lot of different algorithms to compute pi. We used the Nilakantha series, which converges faster than some of the other ones. The Nilakantha series is:

pi = 3 + 4/2x3x4 - 4/4x5x6 - 4/6x7x8, etc.

As we said, this series converges way faster than some of the other series. But what do we mean by converge?

Well, you don't do the algorithm 3 + 4/2x3x4 - 4/4x5x6 and suddenly get 3.14, you have to do it a bunch of times. Why? Each time, you get closer and closer to the right digit. For example, say the first time you do the algorithm, you get 3.15, which is not right. Then, say you get 3.23, which is also not right. It might take 1,000 tries just to get to the first digit. Then, it moves on to the next digit. That is why it is much more convenient to use a computer to compute pi. We used fortran to compute this algorithm, then show the number of digits you ask for. And yes, it was much harder than it seems.