# Pi Calculation

Number of Digits:

Add Count:
Add Spaces:
Answer appears here

Even though this is a rather slow program, it calculates 1000 digits of pi in about 13 seconds (13.028 seconds on one occasion), on a slow computer. The time taken to calculate a given number of digits does not merely double on doubling the number of digits, but increases about fourfold. So we would expect 2000 digits to take four times as long. Internet Explorer gives a message saying the script seems to be running for a long time. Press "No" to continue, or "Yes" to abort. It reports 57.993 seconds for 2000 digits. To calculate to 5000 places, the program took 324.266 seconds, with Internet Explorer complaining twice.

The program doesn't round the final digit, but reports 5 more digits than requested, some of these five may be wrong (the last few digits calculated with the Machin formula will nearly always be wrong). The digits requrested will, however, be correct. You can check digits using the pi search.

In 1666 Sir Isaac Newton calculated pi to 15 places. He used a formula of his own devising. This formula was extremely slow to converge, and I suspect that Newton may have spent months, or even years, rather than hours, calculating 15 places.

In 1706, John Machin proposed a formula that converged very quickly.

Using Machin's formula, in 1873, William Shanks, after many years of labour, published his calculation of  pi to 707 places.

A Frenchman called Dagbert, memorised pi to 707 places, indicating that he had used Shanks work. It was quite popular for some mathematics students to learn pi to many digits, using Shanks work. However, it was only in the 1930s that suspicians began to arise that Shanks had made an error. In fact, he had made an error in the 528th place, so the remaining 180 digits were wrong. Professor Aitken, a mathematician from New Zealand, recorded his chagrin when he discovered that learning 707 decimal places of pi had been in vain.