## Ramanujan’s Formula for Pi

First found by Ramanujan. It’s my favourite formula for pi. I have no idea how it works.

$\frac{1}{\pi} = \frac{\sqrt{8}}{9801} \sum_{n=0}^{\infty}\frac{(4n)!}{(n!)^4}\times\frac{26390n + 1103}{396^{4n}}$

A Ramanujan-type formula due to the Chudnovsky brothers used to break a world record for computing the most digits of pi:

$\frac{1}{\pi} = \frac{1}{53360 \sqrt{640320}} \sum_{n=0}^\infty (-1)^n \frac{(6n)!}{n!^3(3n)!} \times \frac{13591409 + 545140134n}{640320^{3n}}$

For implementations, it may help to use $$640320^3 = 8\cdot 100100025\cdot 327843840$$

Ben Lynn blynn@cs.stanford.edu 💡