Search code examples
mathpi

How to compute N number of Pi


I have found this formula for computing Pi value: enter image description here

But I need to compute only(for example - 1000th) number of Pi value. How I can do it with provided formula?

Thanks.


Solution

  • What you want is called a "spigot algorithm". Take a look at [1] in the section "BBP digit-extraction algorithm for pi". Good luck and have fun.

    [1] http://en.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80%93Plouffe_formula