I know the series, $4{4\over3}+{4\over5}{4\over7}...$ converges to $\pi$ but I have heard many people say that while this is a classic example, there are series that converge much faster. Does anyone know of any?
 356,881
 50
 750
 1,081
 2,242
 2
 18
 22

4Here is a relevant reference: http://en.wikipedia.org/wiki/Numerical_approximations_of_%CF%80#Development_of_efficient_formulae – Jonas Meyer Dec 13 '10 at 01:03

A closely related question: http://math.stackexchange.com/questions/297/simplenumericalmethodsforcalculatingthedigitsofpi – Jonas Meyer Dec 13 '10 at 01:05

32That would be Ramanujan's $$\frac{1}{\pi} = \frac{2 \sqrt 2}{9801} \sum_{k=0}^\infty \frac{(4k)!(1103+26390k)}{(k!)^4 396^{4k}}$$ or the Chudnovsky brothers' $$\frac{426880 \sqrt{10005}}{\pi} = \sum_{k=0}^\infty \frac{(6k)! (13591409 + 545140134k)}{(3k)!(k!)^3 (640320)^{3k}}$$ – J. M. ain't a mathematician Dec 13 '10 at 01:15

4As an additional note: when using the series for the arctangent, the series converges more slowly as one is nearing the convergence boundary $z=1$ ; the reason Machin's formulae work well is that it expresses $\pi$ as sums of arctangent series with arguments near the point of expansion $z=0$. – J. M. ain't a mathematician Dec 13 '10 at 01:20

2@J.M. I think your last comment, if expanded a bit, can be a good answer to the question. – Willie Wong Dec 13 '10 at 01:38

I just restated what's been said in other answers scattered around this site, so I'm okay with these staying as comments. :) – J. M. ain't a mathematician Dec 13 '10 at 11:25

J.M.: Which is the faster, Ramanujan's or the Chudnovsky brothers'? – NotSuper Dec 25 '10 at 09:24

@NotSuper: The Chudnovskys' formula. Compare the decay rate of the terms of both series... – J. M. ain't a mathematician Jul 30 '11 at 17:33
11 Answers
The series $$ \sum_{n=0}^{\infty} \frac{(2n)!!}{(2n+1)!!} \left(\frac{1}{2}\right)^n = \frac{\pi}{2}$$ converges quickly. Here $!!$ is the double factorial defined by $0!! = 1!! = 1$ and $n!! = n (n2)!!$
This is series is not too hard to derive. Start by defining $$f(t) = \sum _{n=0}^{\infty } \frac{(1)^n}{(2n+1)}t^n.$$ Note that $f(1) = \pi/4$ is the series you referenced. Now we take what is called the Euler Transform of the series which gives us $$ \left(\frac{1}{1t}\right)f\left(\frac{t}{1t}\right) = \sum _{n=0}^{\infty } \left(\sum _{k=0}^n {n \choose k}\frac{(1)^k}{(2k+1)}\right)t^n.$$
Now $$\sum _{k=0}^n {n \choose k}\frac{(1)^k}{(2k+1)} = \frac{(2n)!!}{(2n+1)!!}$$ for hints on how to prove this identity see Proving a binomial sum identity $\sum _{k=0}^n \binom nk \frac{(1)^k}{2k+1} = \frac{(2n)!!}{(2n+1)!!}$. Now put $t = 1/2$ and the identity follows. Showing the error term for the nth partial sum is less than $(1/2)^n$ is not too difficult.

4You know, you could've used $\arctan$ instead of $f$, and it'd be a bit clearer... :) – J. M. ain't a mathematician Dec 13 '10 at 09:05

In hypergeometric form, the first series is ${}_2 F_1\left(1,1;\frac32;\frac12\right)=2\arcsin\left(\sqrt{\frac12}\right)$ . – J. M. ain't a mathematician Dec 13 '10 at 09:14
The BBP formula is another nice one: $$ \pi = \sum_{k=0}^\infty \left[ \frac{1}{16^k} \! \left( \frac{4}{8k+1}  \frac{2}{8k+4}  \frac{1}{8k+5}  \frac{1}{8k+6} \right) \right] $$ It can be used to compute the $n$th hexadecimal digit of $\pi$ without computing the preceding $n{}1$ digits.
 1,374
 1
 9
 12

That's not true: The first n1 elements in the series do impact the nth digit, since each element is just a number with an infinite hexadecimal expansion *starting* around the kth digit. it impacts the other digits a lot. – Ekuurh Sep 17 '14 at 09:46

@Ekuurh: You're right, the formulation "can be used" might be a bit misleading. The formula _can_ be used for what I claim, but with increasing $n$ the computing time [increases like $n\ln n$](http://en.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80%93Plouffe_formula#BBP_compared_to_other_methods_of_computing_.CF.80). – Hendrik Vogt Sep 19 '14 at 06:58

1Is there a version of that formula that has a 1/10^k term instead of a 1/16^k one? – Omnifarious Mar 14 '17 at 16:19

But in practice I don't understand how you do this. Say I want to get the thousandth hexadecimal digit without having to calculate all the previous digits. Is it the integer part of what's in the parenthesis? It can't be because the whole series converges to pi so there must be not pieces floating around, no? – plus1 Jun 07 '19 at 07:44

Hello again, I guess I have answered my own comment above, and the answer is here: https://en.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80%93Plouffe_formula – plus1 Sep 24 '19 at 05:43
I think you may find interesting to browse the webpage of Jon Borwein, which I would call the standard reference for your question. In particular, take a look at the latest version of his talk on "The life of pi" (and its references!), which includes many of the fast converging algorithms and series used in practice for high precision computations of $\pi$, such as the one from this Summer.
 75,806
 9
 204
 327
Just to give people an idea on convergence rates, here is a plot of $\log_{10}\left\frac{S_n\pi}{\pi}\right$ versus $n$ , where $S_n$ is the nth partial sum of the series in question, for three of the series featured in the answers to this question (note the vertical scale):
The three series are, from top to bottom, $\arctan(1)$ (the series mentioned by the OP), $2\arcsin\left(\sqrt{\frac12}\right)$ (the series mentioned by yjj in his answer), and the series by Ramanujan I mentioned in the comments (I didn't include the series by the Chudnovsky brothers, since that converges even faster than the Ramanujan series, and that makes for boring plots).
 71,951
 6
 191
 335
Here is a really nice one due to Simon Plouffe. There are many similar examples in his linked paper.
$$\pi = 72\sum_{n=1}^\infty \frac{1}{n(e^{n\pi}  1)}  96\sum_{n=1}^\infty \frac{1}{n(e^{2n\pi}  1)} + 24\sum_{n=1}^\infty \frac{1}{n(e^{4n\pi}  1)} .$$
What I like about it is that I can see at a glance that the series converge rapidly without having to make some mental estimate of the size of factorials.
 13,233
 34
 59

29...but there's a $\pi$ in the individual terms... :D – J. M. ain't a mathematician Dec 13 '10 at 11:24

@J.M. Agreed, this does detract from it somewhat, but it still impresses me nevertheless. – Derek Jennings Dec 13 '10 at 11:30

1This isn't necessarily circular though, as there are [algorithms](https://en.wikipedia.org/wiki/Gelfond's_constant#Numerical_value) which compute $e^{\pi}$ very efficiently without using the value of $\pi$. In a similar manner, there are algorithms which compute $\sin\frac{\pi}{n}$ for $n\in\mathbb{N}$ without using the value of $\pi$. Also, $e^\pi$ is one of the most accessible transcendental numbers in terms of computation. – Wane Mar 23 '21 at 13:31
Here's a formula which I found embedded in an old C program. I don't know where this comes from, but it converges to Pi very quickly, about 16 correct digits in just 22 iterations:
$\pi = \sum_{i=0}^{\infty}{ \frac{6(\prod{2j1})} {(\prod{2j})(2i+1)(2^{2i+1})}}$
(The products are from 1 to i, so that for i=0 the products are empty, essentially 1/1. For i=1, the products are 1/2. For i=2, the products are (1*3)/(2*4). For i=3, the products are (1*3*5)/(2*4*6). Etc, ad infinitum.)
I have no idea of the provenance of that formula, but on running the C program, it produces:
Index = 0 Sum = 3.000000000000000
Index = 1 Sum = 3.125000000000000
Index = 2 Sum = 3.139062500000000
Index = 3 Sum = 3.141155133928572
Index = 4 Sum = 3.141511172340030
Index = 5 Sum = 3.141576715774867
Index = 6 Sum = 3.141589425319122
Index = 7 Sum = 3.141591982358383
Index = 8 Sum = 3.141592511157862
Index = 9 Sum = 3.141592622870617
Index = 10 Sum = 3.141592646875561
Index = 11 Sum = 3.141592652105887
Index = 12 Sum = 3.141592653258738
Index = 13 Sum = 3.141592653515338
Index = 14 Sum = 3.141592653572930
Index = 15 Sum = 3.141592653585950
Index = 16 Sum = 3.141592653588912
Index = 17 Sum = 3.141592653589590
Index = 18 Sum = 3.141592653589746
Index = 19 Sum = 3.141592653589782
Index = 20 Sum = 3.141592653589790
Index = 21 Sum = 3.141592653589792
Index = 22 Sum = 3.141592653589793
Which is 16 correct significant figures in just 22 iterations, which is actually pretty darn fast. Many serieses which converge to Pi do so with infuriating slowness, requiring 1000 iterations to get 3.1429384 which wrong after the first 3 digits. But not THIS formula! It generates almost as many good digits as iterations.
 51
 5

Is that based on the Taylor series for $\sin^{1}(\frac{1}{2})$? I remember at school (long, long ago) trying to calculate $\pi$ and realising that I would not get far with $\tan^{1}(1)$. The internet did not exist yet and neither the school nor the local library could help. I managed to figure out the Taylor series for $\sin^{1}$ which was much better. I think that I got a new decimal place for every $1.6$ terms. In 1976, I got 500dp from a Fortran program. Some time in the 90s, I ported it to C and got a million places but that required a month of run time. – badjohn May 29 '18 at 15:56

@badjohn: In Wolfram Alpha, I see that the MacLaurin Series for arcsin is: sin^{1}(x) = Sum{frac{Prod(n+1/2)}{sqrt{pi}(2n+1)n!}x^{2n+1}}. Yes, that looks suspiciously familiar. arcsin(1/2)=pi/6. That gives pi^{3/2} = 6 Sum{frac{Prod(n+1/2)}{(2n+1)n! 2^{2n+1}}}; pi^{3/2} = 6 Sum{frac{Prod(2n+1)}{2^n(2n+1)n! 2^{2n+1}}} ; pi^{3/2} = 6 Sum{frac{Prod(2n+1)}{2^n(2n+1)n! 2^{2n+1}}} Very close, but I can't see how to get rid of the 3/2 exponent on pi. The Prod(2n+1) in the numerator partially cancels with the n! in the denominator, but I'm not seeing how to make it identical to my series. – Robbie Hatley May 31 '18 at 05:32

@badjohn: In Wolfram Alpha, I see that the MacLaurin Series for arcsin is: $sin^{1}(x) = Sum{\frac{\prod(n+1/2)}{\sqrt{pi}(2n+1)n!}x^{2n+1}}$. Yes, that looks suspiciously familiar. arcsin(1/2)=pi/6. That gives $pi^{3/2} = 6 Sum{\frac{\prod(n+1/2)}{(2n+1)n! 2^{2n+1}}}; \pi^{3/2} = 6 \sum{\frac{\prod(2n+1)}{2^n(2n+1)n! 2^{2n+1}}} ; \pi^{3/2} = 6 \sum{\frac{\prod(2n+1)}{2^n(2n+1)n! 2^{2n+1}}}$ Very close, but I can't see how to get rid of the 3/2 exponent on pi. – Robbie Hatley May 31 '18 at 05:40

@badjohn : ps: sorry for the repeated comments, but Stack Exchange's braindead "comments" system won't allow me to edit the first comment (because "comments may only be edited for 5 minutes"), and it won't allow me to delete it. Just two more of the infuriating features of the "Stack Exchange" series of sites. (Along with their idiotic "karma / reputation" system which guarantees upvoting of bad answers and downvoting of good answers by "good old boy" back slapping & back stabbing rather than by merit. Idiotic system.) – Robbie Hatley May 31 '18 at 05:47

I don't remember the problem with the 3/2 exponent. Somehow, I got my program to work. Many years later, I was able to verify my calculation of $\pi$ to a million decimal places. I still have the code but not the work on which it was based so I would need to reverse engineer it to get the MacLaurin series. I still use the program occasionally as a calculation intensive benchmark. – badjohn May 31 '18 at 09:25

A quick search finds some reasonably simple series for arcsin though I have only found ones that show a few terms and no general formula for the terms. http://www.efunda.com/math/taylor_series/inverse_trig.cfm What I did long ago was calculate the first few derivatives by hand, guessed a pattern, and proved that pattern by induction. My program was able to calculate one term by a few operations on the previous one. The hard part was developing the routines for working with many decimal places. No off the shelf libraries in those days. – badjohn May 31 '18 at 09:34
You should take a look at the paper: Some New Formulas for π by Gert Almkvist, Christian Krattenthaler, and Joakim Petersson, Experiment. Math. Volume 12, Number 4 (2003), 441456.
 71,951
 6
 191
 335
 10,572
 8
 40
 69
Your series may be written as $$\frac{\pi}{4}=\sum_{k=0}^{\infty}\left(\frac{1}{4k+1}\frac{1}{4k+3}\right)$$
Its truncation approximations improve if the zero relation (http://oeis.org/A176563) $$0=\sum_{k=0}^{\infty}\left(\frac{1}{4k+1}\frac{3}{4k+2}+\frac{1}{4k+3}+\frac{1}{4k+4}\right)$$
is added to obtain $$\frac{\pi}{4}=\sum_{k=0}^{\infty}\left(\frac{2}{4k+1}\frac{3}{4k+2}+\frac{1}{4k+4}\right)$$ $$=\frac{3}{4}\sum_{k=0}^{\infty}\frac{1}{(4k+1)(2k+1)(k+1)}$$
(Lehmer, http://matwbn.icm.edu.pl/ksiazki/aa/aa27/aa27121.pdf, http://oeis.org/A079588)
Although this is the slowest series in all answers, it illustrates how an absolutely convergent series of unit fractions for $\frac{\pi}{3}$ may be obtained by summing up two conditionally convergent series that have been regrouped.
This simple series also explains Why is $\pi$ so close to $3$? by taking the first term out of the summation.
 4,924
 1
 21
 41
Not the fastest but much faster than a lot of the "simple" formulas you may have heard:
$\pi=\displaystyle\sum^{\infty}_{n=0}{\frac{n!\left(2n\right)!\left(25n3\right)}{2^{n1}\left(3n\right)!}}$
Produces a digit or more of $\pi$ per term.
 1,013
 7
 19
The convergence can be arbitrary fast unless you don't specify what kind of series you are looking. Let $k$ be a positive integer, $a_n=\pi/k$ if $n\leq k$ and zero elsewhere. Then $\sum_{n=1}^\infty a_n$ converges to $\pi$ after $k$ summands.
 1,251
 10
 18

3...I'm missing the point of this answer, apparently. – J. M. ain't a mathematician Dec 13 '10 at 15:21

My point is that for every positive integer $k$ you can find a sequence whose $k$ first terms gives $\pi$, namely $\pi=\pi/k+\ldots + \pi/k$. – Jaska Dec 13 '10 at 15:31

My point is that the speed of convergence depends very much of the numbers you can use. If you use algebraic numbers then you need infinitely many terms. But if you can use transcendental numbers then you can do the same in finitely many terms. If $S$ is a set of real numbers whose sum is $\pi$ then $S$ can be anything greater than 0. – Jaska Dec 13 '10 at 16:53

51: The whole point of the question is to be able to compute a reasonable approximation to $\pi$ quickly. If your terms involve $\pi$, you are stuck in a loop... – Aryabhata Dec 13 '10 at 17:22

6@Jaska: Any real number $x$ can be represented as a "sum" of just _one_ real number, namely $x=x$. If you don't like this "sum", say $x=x/2+x/2$. This is true, but not helpful at all. (By the way, I didn't vote down.) – Hendrik Vogt Dec 13 '10 at 17:43

1@Hendrik Vogt: That is true. And in my opinion @Joe should tell first what kind of real numbers he wants to use in the series. There is also $\pi$ in Derek Jennings's post so I'm wondering why my series is worse than the one Jennings gave. – Jaska Dec 13 '10 at 18:11

6@Jaska: Derek cited an _interesting_ series, which is, however, not _helpful_, as it contains $\pi$ (as J.M. already remarked). No offence meant at all: I wouldn't say your finite sum is _worse_, but I'd regard it neither interesting nor helpful. – Hendrik Vogt Dec 13 '10 at 18:23

4This is like saying that $\pi=\sum_{i=1}^1 \pi$ is a rapidly converging series. It might be true but it's not useful at all. It's only correct by a technicality. – Jam Oct 14 '17 at 12:17

@HendrikVogt It is not true that Derek's series is "not helpful"; see my comment under his answer. – Wane Mar 23 '21 at 13:48