TOPICS
Search

Pi Formulas


Pi formulas take many forms. Among others, these include series, products, geometric constructions involving pi, limits, special values, and pi iterations.

pi is intimately related to the properties of circles and spheres. For a circle of radius r, the circumference and area are given by

C=2pir
(1)
A=pir^2.
(2)

Similarly, for a sphere of radius r, the surface area and volume enclosed are

S=4pir^2
(3)
V=4/3pir^3.
(4)

One of the earliest rapidly convergent formulas is Newton's pi series, derived in 1666 from the binomial series and the area of a circular segment,

 pi=(3sqrt(3))/4+24(1/(12)-1/(5·2^5)-1/(28·2^7)-1/(72·2^9)-...)
(5)

(Wells 1986, p. 50; Borwein et al. 1989; Borwein and Bailey 2003, pp. 105-106; Veritasium 2021).

An exact formula for pi in terms of the inverse tangents of unit fractions is Machin's formula

 1/4pi=4tan^(-1)(1/5)-tan^(-1)(1/(239)).
(6)

There are three other Machin-like formulas, as well as thousands of other similar formulas having more terms.

GregorySeries

Gregory and Leibniz found

pi/4=sum_(k=1)^(infty)((-1)^(k+1))/(2k-1)
(7)
=1-1/3+1/5-...
(8)

(Wells 1986, p. 50), which is known as the Gregory series and may be obtained by plugging x=1 into the Leibniz series for tan^(-1)x. The absolute error after n terms of the series for pi/4 lies strictly between 1/(4n+2) and 1/(2n+1). Multiplying the 300-term sum by 4 gives 3.1382593..., with an absolute error of approximately 0.0033333. The series can be transformed to

 pi=sum_(k=1)^infty(3^k-1)/(4^k)zeta(k+1),
(9)

where zeta(z) is the Riemann zeta function (Vardi 1991, pp. 157-158; Flajolet and Vardi 1996), so that the error after k terms is asymptotic to 3(3/4)^k.

A series attributed to Abraham Sharp (ca. 1717) is

 pi=sum_(k=0)^infty(2(-1)^k3^(1/2-k))/(2k+1)
(10)

(Smith 1953, p. 311). Additional simple series in which pi appears are

1/4pisqrt(2)=sum_(k=1)^(infty)[((-1)^(k+1))/(4k-1)+((-1)^(k+1))/(4k-3)]
(11)
=1+1/3-1/5-1/7+1/9+1/(11)-...
(12)
1/4(pi-3)=sum_(k=1)^(infty)((-1)^(k+1))/(2k(2k+1)(2k+2))
(13)
=1/(2·3·4)-1/(4·5·6)+1/(6·7·8)-...
(14)
1/6pi^2=sum_(k=1)^(infty)1/(k^2)
(15)
=1+1/4+1/9+1/(16)+1/(25)+...
(16)
1/8pi^2=sum_(k=1)^(infty)1/((2k-1)^2)
(17)
=1+1/(3^2)+1/(5^2)+1/(7^2)+...
(18)

(Wells 1986, p. 53).

An application of Euler's convergence improvement transformation gives

pi/2=1/2sum_(n=0)^(infty)((n!)^22^(n+1))/((2n+1)!)=sum_(n=0)^(infty)(n!)/((2n+1)!!)
(19)
=1+1/3+(1·2)/(3·5)+(1·2·3)/(3·5·7)+...
(20)
=1+1/3(1+2/5(1+3/7(1+4/9(1+...))))
(21)

(Beeler et al. 1972, Item 120).

This corresponds to plugging x=1/sqrt(2) into the power series for the hypergeometric function _2F_1(a,b;c;x),

 (sin^(-1)x)/(sqrt(1-x^2))=sum_(i=0)^infty((2i)!!x^(2i+1))/((2i+1)!!)=_2F_1(1,1;3/2;x^2)x,
(22)

where n!! denotes the double factorial. Despite the convergence improvement, series (19) converges at only one bit per term. At the cost of a square root, Gosper has noted that x=1/2 gives 2 bits per term,

 1/9sqrt(3)pi=1/2sum_(i=0)^infty((i!)^2)/((2i+1)!),
(23)

and x=sin(pi/10) gives almost 3.39 bits per term,

 pi/(5sqrt(phi+2))=1/2sum_(i=0)^infty((i!)^2)/(phi^(2i+1)(2i+1)!),
(24)

where phi is the golden ratio.

Another series involving the golden ratio is

 pi=4sum_(n=0)^inftyphi^(-12n)((phi^(-1))/(12n+1)+(2phi^(-3))/(12n+3)+(phi^(-5))/(12n+5)-(phi^(-7))/(12n+7)-(2phi^(-9))/(12n+9)-(phi^(-11))/(12n+11)).
(25)

This was communicated by B. Cloitre (pers. comm., Dec. 13, 2007). Pardeshi (2022) gives an equivalent form by extracting the first term 4/phi and shifting the remaining terms with denominator 12n+1 to denominator 12n+13. For a short proof, the inverse tangent addition formula gives tan^(-1)(phi^(-1))+tan^(-1)(phi^(-3))=pi/4. Expanding the two inverse tangents in their absolutely convergent Taylor series and grouping terms by their exponents modulo 12 gives the result.

Gosper also obtained

 pi=3+1/(60)(8+(2·3)/(7·8·3)(13+(3·5)/(10·11·3)(18+(4·7)/(13·14·3)(23+...)))).
(26)

A rapidly convergent series given by Hakimoglu-Brown (2024) is

 pi=(sqrt(3))/(60)sum_(n=0)^infty((2n)!(130n+109))/((7/6)_n(11/6)_n(-1296)^n),
(27)

where (a)_n is the Pochhammer symbol. The summands are rational numbers, with an algebraic prefactor sqrt(3)/60. The ratio of successive terms tends to -1/324, giving approximately log_(10)324=2.51055 decimal digits per term. An equivalent form posed by Sun (2024) is

 pi=-(3sqrt(3))/2sum_(k=1)^infty((130k-21)(2k; k))/(k(2k-1)(-3)^k(3k; k)(6k; 3k)).
(28)

The two forms agree term by term after the index shift k=n+1 and their respective prefactors are included.

Various limits also converge to pi, a simple example being

 lim_(n->infty)ncos((pi(n-2))/(2n))=pi.
(29)

More interesting examples are given by

 lim_(n->infty)((2(-1)^(n+1)(2n)!)/(2^(2n)B_(2n)))^(1/(2n))=pi,
(30)

and

 lim_(n->infty)((2(-1)^(n+1)(2n)!)/(2^(2n)B_(2n)(1-2^(-2n))(1-3^(-2n))(1-5^(-2n))(1-7^(-2n))))^(1/(2n))=pi,
(31)

where B_n is a Bernoulli number (Plouffe 2022). These formulas give rapidly converging approximations to pi; certifying pi digits from an approximation requires an error bound that excludes crossing a digit-truncation boundary.

A spigot algorithm for pi is given by Rabinowitz and Wagon (1995; Borwein and Bailey 2003, pp. 141-142).

An explicit series representation giving another digit-extraction algorithm which produces digits of pi (or pi^2) in base 16 was discovered by Bailey et al. (Bailey et al. 1997, Adamchik and Wagon 1997),

 pi=sum_(n=0)^infty(4/(8n+1)-2/(8n+4)-1/(8n+5)-1/(8n+6))(1/(16))^n.
(32)

This formula, known as the BBP formula, was discovered using the PSLQ algorithm (Ferguson et al. 1999) and is equivalent to

 pi=int_0^1(16y-16)/(y^4-2y^3+4y-4)dy.
(33)

There are BBP-type formulas for pi with alternating signs, including

pi=4sum_(k=0)^(infty)((-1)^k)/(2k+1)
(34)
=3sum_(k=0)^(infty)(-1)^k[1/(6k+1)+1/(6k+5)]
(35)
=4sum_(k=0)^(infty)(-1)^k[1/(10k+1)-1/(10k+3)+1/(10k+5)-1/(10k+7)+1/(10k+9)]
(36)
=sum_(k=0)^(infty)(-1)^k[3/(14k+1)-3/(14k+3)+3/(14k+5)+4/(14k+7)+3/(14k+9)-3/(14k+11)+3/(14k+13)]
(37)
=sum_(k=0)^(infty)(-1)^k[2/(18k+1)+3/(18k+3)+2/(18k+5)-2/(18k+7)-2/(18k+11)+2/(18k+13)+3/(18k+15)+2/(18k+17)]
(38)
=sum_(k=0)^(infty)(-1)^k[3/(22k+1)-3/(22k+3)+3/(22k+5)-3/(22k+7)+3/(22k+9)+8/(22k+11)+3/(22k+13)-3/(22k+15)+3/(22k+17)-3/(22k+19)+3/(22k+21)].
(39)

Similarly, examples of BBP-type formulas for pi with bases that are powers of 2 are

pi=sum_(k=0)^(infty)1/(16^k)[4/(8k+1)-2/(8k+4)-1/(8k+5)-1/(8k+6)]
(40)
=1/2sum_(k=0)^(infty)1/(16^k)[8/(8k+2)+4/(8k+3)+4/(8k+4)-1/(8k+7)]
(41)
=1/(16)sum_(k=0)^(infty)1/(256^k)[(64)/(16k+1)-(32)/(16k+4)-(16)/(16k+5)-(16)/(16k+6)+4/(16k+9)-2/(16k+12)-1/(16k+13)-1/(16k+14)]
(42)
=1/(32)sum_(k=0)^(infty)1/(256^k)[(128)/(16k+2)+(64)/(16k+3)+(64)/(16k+4)-(16)/(16k+7)+8/(16k+10)+4/(16k+11)+4/(16k+12)-1/(16k+15)]
(43)
=1/(32)sum_(k=0)^(infty)1/(4096^k)[(256)/(24k+2)+(192)/(24k+3)-(256)/(24k+4)-(96)/(24k+6)-(96)/(24k+8)+(16)/(24k+10)-4/(24k+12)-3/(24k+15)-6/(24k+16)-2/(24k+18)-1/(24k+20)]
(44)
=1/(64)sum_(k=0)^(infty)1/(4096^k)[(256)/(24k+1)+(256)/(24k+2)-(384)/(24k+3)-(256)/(24k+4)-(64)/(24k+5)+(96)/(24k+8)+(64)/(24k+9)+(16)/(24k+10)+8/(24k+12)-4/(24k+13)+6/(24k+15)+6/(24k+16)+1/(24k+17)+1/(24k+18)-1/(24k+20)-1/(24k+21)]
(45)
=1/(96)sum_(k=0)^(infty)1/(4096^k)[(256)/(24k+2)+(64)/(24k+3)+(128)/(24k+5)+(352)/(24k+6)+(64)/(24k+7)+(288)/(24k+8)+(128)/(24k+9)+(80)/(24k+10)+(20)/(24k+12)-(16)/(24k+14)-1/(24k+15)+6/(24k+16)-2/(24k+17)-1/(24k+19)+1/(24k+20)-2/(24k+21)]
(46)
=1/(96)sum_(k=0)^(infty)1/(4096^k)[(256)/(24k+1)+(320)/(24k+3)+(256)/(24k+4)-(192)/(24k+5)-(224)/(24k+6)-(64)/(24k+7)-(192)/(24k+8)-(64)/(24k+9)-(64)/(24k+10)-(28)/(24k+12)-4/(24k+13)-5/(24k+15)+3/(24k+17)+1/(24k+18)+1/(24k+19)+1/(24k+21)-1/(24k+22)]
(47)
=1/(96)sum_(k=0)^(infty)1/(4096^k)[(512)/(24k+1)-(256)/(24k+2)+(64)/(24k+3)-(512)/(24k+4)-(32)/(24k+6)+(64)/(24k+7)+(96)/(24k+8)+(64)/(24k+9)+(48)/(24k+10)-(12)/(24k+12)-8/(24k+13)-(16)/(24k+14)-1/(24k+15)-6/(24k+16)-2/(24k+18)-1/(24k+19)-1/(24k+20)-1/(24k+21)]
(48)
=1/(4096)sum_(k=0)^(infty)1/(65536^k)[(16384)/(32k+1)-(8192)/(32k+4)-(4096)/(32k+5)-(4096)/(32k+6)+(1024)/(32k+9)-(512)/(32k+12)-(256)/(32k+13)-(256)/(32k+14)+(64)/(32k+17)-(32)/(32k+20)-(16)/(32k+21)-(16)/(32k+22)+4/(32k+25)-2/(32k+28)-1/(32k+29)-1/(32k+30)]
(49)
=1/(8192)sum_(k=0)^(infty)1/(65536^k)[(32768)/(32k+2)+(16384)/(32k+3)+(16384)/(32k+4)-(4096)/(32k+7)+(2048)/(32k+10)+(1024)/(32k+11)+(1024)/(32k+12)-(256)/(32k+15)+(128)/(32k+18)+(64)/(32k+19)+(64)/(32k+20)-(16)/(32k+23)+8/(32k+26)+4/(32k+27)+4/(32k+28)-1/(32k+31)].
(50)

Bellard (1997a) found the rapidly converging BBP-type formula

 pi=1/(2^6)sum_(n=0)^infty((-1)^n)/(2^(10n))(-(2^5)/(4n+1)-1/(4n+3)+(2^8)/(10n+1)-(2^6)/(10n+3)-(2^2)/(10n+5)-(2^2)/(10n+7)+1/(10n+9)).
(51)

A related integral is

 pi=(22)/7-int_0^1(x^4(1-x)^4)/(1+x^2)dx
(52)

(Dalzell 1944, 1971; Le Lionnais 1983, p. 22; Borwein et al. 2004a, p. 3; Boros and Moll 2004, p. 125; Lucas 2005; Borwein et al. 2007, p. 14). This integral was known by K. Mahler in the mid-1960s and appears in an exam at the University of Sydney in November 1960 (Borwein et al. 2004a, p. 3). For the next convergent, Lucas (2009) obtained

 pi=(333)/(106)+1/(530)int_0^1(x^5(1-x)^6(197+462x^2))/(1+x^2)dx.
(53)

The fourth convergent satisfies

 pi=(355)/(113)-1/(3164)int_0^1(x^8(1-x)^8(25+816x^2))/(1+x^2)dx.
(54)

(Lucas 2005; Bailey et al. 2007, p. 219). Lucas (2005, 2009) gives further such integrals.

Backhouse (1995) used the identity

I_(m,n)=int_0^1(x^m(1-x)^n)/(1+x^2)dx
(55)
=(Gamma(m+1)Gamma(n+1))/(Gamma(m+n+2))×_3F_2(1,(m+1)/2,(m+2)/2;(m+n+2)/2,(m+n+3)/2;-1)
(56)
=a+bpi+cln2
(57)

for positive integers m and n, where a, b, and c are rational constants to generate a number of formulas for pi. In particular, if 2m-n=0 (mod 4), then c=0 (Lucas 2005).

A similar formula was subsequently discovered by Ferguson, leading to a two-dimensional lattice of such formulas which can be generated by these two formulas given by

 pi=sum_(k=0)^infty((4+8r)/(8k+1)-(8r)/(8k+2)-(4r)/(8k+3)-(2+8r)/(8k+4)-(1+2r)/(8k+5)-(1+2r)/(8k+6)+r/(8k+7))(1/(16))^k
(58)

for any complex value of r (Adamchik and Wagon), giving the BBP formula as the special case r=0.

PiFormulasWagonIdentity

An even more general identity due to Wagon is given by

 pi+4tan^(-1)z+2ln((1-2z-z^2)/(z^2+1))=sum_(k=0)^infty1/(16^k)[(4(z+1)^(8k+1))/(8k+1)-(2(z+1)^(8k+4))/(8k+4)-((z+1)^(8k+5))/(8k+5)-((z+1)^(8k+6))/(8k+6)]
(59)

(Borwein and Bailey 2003, p. 141). With principal branches on the left, the series converges and the identity holds for |z+1|<sqrt(2). Analytic continuation beyond this disk depends on branch choices, as illustrated above.

A perhaps even stranger general class of identities is given by

 pi=4sum_(j=1)^n((-1)^(j+1))/(2j-1)+((-1)^n(2n-1)!)/4sum_(k=0)^infty1/(16^k)[8/((8k+1)_(2n))-4/((8k+3)_(2n))-4/((8k+4)_(2n))-2/((8k+5)_(2n))+1/((8k+7)_(2n))+1/((8k+8)_(2n))]
(60)

which holds for any positive integer n, where (x)_n is a Pochhammer symbol (B. Cloitre, pers. comm., Jan. 23, 2005). Even more amazingly, there is a closely analogous formula for the natural logarithm of 2.

Following the discovery of the base 16 digit BBP formula and related formulas, similar formulas in other bases were investigated. Borwein et al. (2004b) proved that, for an integer base b>2 that is not a perfect power, pi has no Machin-type BBP formula expressing it as a finite rational linear combination of tan^(-1)(-b^(-m)) with positive integers m. This does not rule out other digit-extraction algorithms in such bases.

S. Plouffe has devised an algorithm to compute the nth digit of pi in any base in O(n^3(logn)^3) steps.

A slew of additional identities due to Ramanujan, Catalan, and Newton are given by Castellanos (1988ab, pp. 86-88), including several involving sums of Fibonacci numbers. Ramanujan found

 sum_(k=0)^infty((-1)^k(4k+1)[(2k-1)!!]^3)/([(2k)!!]^3)=sum_(k=0)^infty((-1)^k(4k+1)[Gamma(k+1/2)]^3)/(pi^(3/2)[Gamma(k+1)]^3)=2/pi
(61)

(Hardy 1923, 1924, 1999, p. 7).

Plouffe (2006) found the beautiful formula

 pi=72sum_(n=1)^infty1/(n(e^(npi)-1))-96sum_(n=1)^infty1/(n(e^(2npi)-1))+24sum_(n=1)^infty1/(n(e^(4npi)-1)).
(62)
PiBlatnerProduct

An interesting infinite product formula due to Euler which relates pi and the nth prime p_n is

pi=2/(product_(n=1)^(infty)[1+(sin(1/2pip_n))/(p_n)])
(63)
=2/(product_(n=2)^(infty)[1+((-1)^((p_n-1)/2))/(p_n)])
(64)

(Blatner 1997, p. 119), plotted above as a function of the number of terms in the product.

A method similar to Archimedes' can be used to estimate pi by starting with a regular polygon with n>=3 sides and repeatedly doubling the number of sides. Let beta=pi/n be half the central angle subtended by one side. Repeated use of the double-angle formulas gives

 pi=(nsinbeta)/(product_(k=1)^(infty)cos(2^(-k)beta))
(65)

(Beckmann 1989, pp. 92-94).

Vieta (1593) was the first to give an exact expression for pi by taking n=4 in the above expression, giving

 cosbeta=sinbeta=1/(sqrt(2))=1/2sqrt(2),
(66)

which leads to an infinite product of nested radicals,

 2/pi=sqrt(1/2)sqrt(1/2+1/2sqrt(1/2))sqrt(1/2+1/2sqrt(1/2+1/2sqrt(1/2)))...
(67)

(Wells 1986, p. 50; Beckmann 1989, p. 95). Rudio (1891) gave a rigorous proof of its convergence.

A related formula is given by

 pi=lim_(n->infty)2^(n+1)sqrt(2-sqrt(2+sqrt(2+sqrt(2+...+sqrt(2))))_()_(n)),
(68)

which can be written

 pi=lim_(n->infty)2^(n+1)pi_n,
(69)

where pi_n is defined using the iteration

 pi_n=sqrt((1/2pi_(n-1))^2+[1-sqrt(1-(1/2pi_(n-1))^2)]^2)
(70)

with pi_0=sqrt(2) (J. Munkhammar, pers. comm., Apr. 27, 2000). The formula

 pi=2lim_(m->infty)sum_(n=1)^msqrt([sqrt(1-((n-1)/m)^2)-sqrt(1-(n/m)^2)]^2+1/(m^2))
(71)

is also closely related.

A pretty formula for pi is given by

 pi=(product_(n=1)^(infty)(1+1/(4n^2-1)))/(sum_(n=1)^(infty)1/(4n^2-1)),
(72)

where the numerator is a form of the Wallis formula for pi/2 and the denominator is a telescoping sum with sum 1/2 since

 1/(4n^2-1)=1/2(1/(2n-1)-1/(2n+1))
(73)

(Sondow 1997).

A particular case of the Wallis formula gives

 pi/2=product_(n=1)^infty[((2n)^2)/((2n-1)(2n+1))]=(2·2)/(1·3)(4·4)/(3·5)(6·6)/(5·7)...
(74)

(Wells 1986, p. 50). This formula can also be written

 lim_(n->infty)(2^(4n))/(n(2n; n)^2)=pilim_(n->infty)(n[Gamma(n)]^2)/([Gamma(1/2+n)]^2)=pi,
(75)

where (n; k) denotes a binomial coefficient and Gamma(x) is the gamma function (Knopp 1990). Euler obtained

 pi=sqrt(6(1+1/(2^2)+1/(3^2)+1/(4^2)+...)),
(76)

which follows from the special value of the Riemann zeta function zeta(2)=pi^2/6. Similar formulas follow from zeta(2n) for all positive integers n.

An infinite sum due to Ramanujan is

 1/pi=sum_(n=0)^infty(2n; n)^3(42n+5)/(2^(12n+4))
(77)

(Borwein et al. 1989; Borwein and Bailey 2003, p. 109; Bailey et al. 2007, p. 44). Further sums are given in Ramanujan (1913-14),

 4/pi=sum_(n=0)^infty((-1)^n(1123+21460n)(2n-1)!!(4n-1)!!)/(882^(2n+1)32^n(n!)^3)
(78)

and

1/pi=sqrt(8)sum_(n=0)^(infty)((1103+26390n)(2n-1)!!(4n-1)!!)/(99^(4n+2)32^n(n!)^3)
(79)
=(sqrt(8))/(9801)sum_(n=0)^(infty)((4n)!(1103+26390n))/((n!)^4396^(4n))
(80)

(Beeler et al. 1972, Item 139; Borwein et al. 1989; Borwein and Bailey 2003, p. 108; Bailey et al. 2007, p. 44). Equation (80) is derived from a modular identity of order 58, although a first derivation was not presented prior to Borwein and Borwein (1987a). The initial-term approximations from the two series are, respectively,

pi approx (3528)/(1123)=3.14158504007...
(81)
 approx (9801)/(2206sqrt(2))=3.14159273001....
(82)

The series provide about 6 and 8 decimal digits per term, respectively (Beeler et al. 1972, Item 139; Wells 1986, p. 54). Such series exist because of the rationality of various modular invariants.

A Chudnovsky-type family of series is

 sum_(n=0)^infty[a(t)+nb(t)]((6n)!)/((3n)!(n!)^3)1/([j(t)]^n)=(sqrt(-j(t)))/pi,
(83)

where t is a positive integer satisfying t=3  (mod4), -t is a negative binary quadratic form discriminant, and tau=1/2(1+isqrt(t)). Here j(t) denotes the j-function evaluated at tau, and the family is taken with j(t)<-1728 so that the series converges. Define

b(t)=sqrt(t[1728-j(t)])
(84)
a(t)=(b(t))/6{1-(E_4(t))/(E_6(t))[E_2(t)-6/(pisqrt(t))]},
(85)

where E_i(t) denotes the Eisenstein series E_i evaluated at tau (Borwein and Borwein 1993). For the equivalent form with denominator C^(3n), set A=a(t), B=b(t), and C equal to the real cube root of j(t). The class number p examples use pth-degree algebraic integers for these constants (Borwein and Borwein 1993). Among this family's class number 1 imaginary quadratic fields, the fastest convergence per term corresponds to the discriminant -163, the largest in absolute value. The corresponding series was given by Chudnovsky and Chudnovsky (1988). The 163 appearing here is the same one appearing in the fact that e^(pisqrt(163)) (the Ramanujan constant) is very nearly an integer. Similarly, the factor 640320^3 comes from the j-function identity for j(1/2(1+isqrt(163))). The series is given by

1/pi=12sum_(n=0)^(infty)((-1)^n(6n)!(13591409+545140134n))/((n!)^3(3n)!(640320^3)^(n+1/2))
(86)
=(163·8·27·7·11·19·127)/(640320^(3/2))sum_(n=0)^(infty)((13591409)/(163·2·9·7·11·19·127)+n)((6n)!)/((3n)!(n!)^3)((-1)^n)/(640320^(3n))
(87)

(Borwein and Borwein 1993; Beck and Trott; Bailey et al. 2007, p. 44). This series gives 14 decimal digits accurately per term. The same equation in another form was given by the Chudnovsky brothers (1988) and is used by the Wolfram Language to calculate pi (Vardi 1991; Wolfram Research),

 pi=(426880sqrt(10005))/(A[_3F_2(1/6,1/2,5/6;1,1;B)-C_3F_2(7/6,3/2,(11)/6;2,2;B)]),
(88)

where A=13591409, B=-1/151931373056000, and C=30285563/1651969144908540723200.

The class number 2 example with discriminant -427 is

 1/pi=12sum_(n=0)^infty((-1)^n(6n)!(A+Bn))/((n!)^3(3n)!C^(n+1/2)),
(89)

where

A=212175710912sqrt(61)+1657145277365
(90)
B=13773980892672sqrt(61)+107578229802750
(91)
C=[5280(236674+30303sqrt(61))]^3
(92)

(Borwein and Borwein 1993). This series adds about 25 decimal digits for each additional term. The fastest converging series for class number 3 corresponds to d=-907 and gives 37-38 decimal digits per term. The class number 4 example computed by Borwein and Borwein (1993) corresponds to d=-1555 and is

 (sqrt(-C^3))/pi=sum_(n=0)^infty((6n)!)/((3n)!(n!)^3)(A+nB)/(C^(3n)),
(93)

where

A=63365028312971999585426220+28337702140800842046825600sqrt(5)+384sqrt(5)(10891728551171178200467436212395209160385656017+4870929086578810225077338534541688721351255040sqrt(5))^(1/2)
(94)
B=7849910453496627210289749000+3510586678260932028965606400sqrt(5)+2515968sqrt(3110)(6260208323789001636993322654444020882161+2799650273060444296577206890718825190235sqrt(5))^(1/2)
(95)
C=-214772995063512240-96049403338648032sqrt(5)-1296sqrt(5)(10985234579463550323713318473+4912746253692362754607395912sqrt(5))^(1/2).
(96)

This gives 50 decimal digits per term. Borwein and Borwein (1993) have developed a general algorithm for generating such series for arbitrary class number.

A complete listing of Ramanujan's series for 1/pi found in his second and third notebooks is given by Berndt (1994, pp. 352-354),

4/pi=sum_(n=0)^(infty)((6n+1)(1/2)_n^3)/(4^n(n!)^3)
(97)
(16)/pi=sum_(n=0)^(infty)((42n+5)(1/2)_n^3)/(64^n(n!)^3)
(98)
(32)/pi=sum_(n=0)^(infty)((42sqrt(5)n+5sqrt(5)+30n-1)(1/2)_n^3)/(64^n(n!)^3)((sqrt(5)-1)/2)^(8n)
(99)
(27)/(4pi)=sum_(n=0)^(infty)((15n+2)(1/2)_n(1/3)_n(2/3)_n)/((n!)^3)(2/(27))^n
(100)
(15sqrt(3))/(2pi)=sum_(n=0)^(infty)((33n+4)(1/2)_n(1/3)_n(2/3)_n)/((n!)^3)(4/(125))^n
(101)
(5sqrt(5))/(2pisqrt(3))=sum_(n=0)^(infty)((11n+1)(1/2)_n(1/6)_n(5/6)_n)/((n!)^3)(4/(125))^n
(102)
(85sqrt(85))/(18pisqrt(3))=sum_(n=0)^(infty)((133n+8)(1/2)_n(1/6)_n(5/6)_n)/((n!)^3)(4/(85))^(3n)
(103)
4/pi=sum_(n=0)^(infty)((-1)^n(20n+3)(1/2)_n(1/4)_n(3/4)_n)/((n!)^32^(2n+1))
(104)
4/(pisqrt(3))=sum_(n=0)^(infty)((-1)^n(28n+3)(1/2)_n(1/4)_n(3/4)_n)/((n!)^33^n4^(2n+1))
(105)
4/pi=sum_(n=0)^(infty)((-1)^n(260n+23)(1/2)_n(1/4)_n(3/4)_n)/((n!)^3(18)^(2n+1))
(106)
4/(pisqrt(5))=sum_(n=0)^(infty)((-1)^n(644n+41)(1/2)_n(1/4)_n(3/4)_n)/((n!)^35^n(72)^(2n+1))
(107)
4/pi=sum_(n=0)^(infty)((-1)^n(21460n+1123)(1/2)_n(1/4)_n(3/4)_n)/((n!)^3(882)^(2n+1))
(108)
(2sqrt(3))/pi=sum_(n=0)^(infty)((8n+1)(1/2)_n(1/4)_n(3/4)_n)/((n!)^39^n)
(109)
1/(2pisqrt(2))=sum_(n=0)^(infty)((10n+1)(1/2)_n(1/4)_n(3/4)_n)/((n!)^39^(2n+1))
(110)
1/(3pisqrt(3))=sum_(n=0)^(infty)((40n+3)(1/2)_n(1/4)_n(3/4)_n)/((n!)^3(49)^(2n+1))
(111)
2/(pisqrt(11))=sum_(n=0)^(infty)((280n+19)(1/2)_n(1/4)_n(3/4)_n)/((n!)^3(99)^(2n+1))
(112)
1/(2pisqrt(2))=sum_(n=0)^(infty)((26390n+1103)(1/2)_n(1/4)_n(3/4)_n)/((n!)^3(99)^(4n+2)).
(113)

These equations were first proved by Borwein and Borwein (1987a, pp. 177-187). Borwein and Borwein (1987b, 1988, 1993) proved other equations of this type, and Chudnovsky and Chudnovsky (1988) found similar equations for other transcendental constants (Bailey et al. 2007, pp. 44-45).

Some independent equations of this type are given by

4/pi=sum_(n=0)^(infty)((6n+1)(1/2)_n^3)/(4^n(n!)^3)
(114)
(16)/pi=sum_(n=0)^(infty)((42n+5)(1/2)_n^3)/(64^n(n!)^3)
(115)
(32)/pi=sum_(n=0)^(infty)((42sqrt(5)n+5sqrt(5)+30n-1)(1/2)_n^3)/(64^n(n!)^3)((sqrt(5)-1)/2)^(8n)
(116)
(5^(1/4))/pi=sum_(n=0)^(infty)((540sqrt(5)n-1200n-525+235sqrt(5))(1/2)_n^3(sqrt(5)-2)^(8n))/((n!)^3)
(117)
(12^(1/4))/pi=sum_(n=0)^(infty)((24sqrt(3)n-36n-15+9sqrt(3))(1/2)_n^3(2-sqrt(3))^(4n))/((n!)^3)
(118)

for m=1 with nonalternating signs,

2/pi=sum_(n=0)^(infty)((-1)^n(1/2)_n^3(12sqrt(2)n-12n-5+4sqrt(2))(sqrt(2)-1)^(4n))/((n!)^3)
(119)
2/pi=sum_(n=0)^(infty)((-1)^n(1/2)_n^3(60n-24sqrt(5)n+23-10sqrt(5))(sqrt(5)-2)^(4n))/((n!)^3)
(120)
2/pi=sum_(n=0)^(infty)((-1)^n(1/2)_n^3(420n-168sqrt(6)n+177-72sqrt(6))(sqrt(3)-sqrt(2))^(8n))/((n!)^3)
(121)
(2sqrt(2))/pi=sum_(n=0)^(infty)((-1)^n(1/2)_n^3(6n+1))/(8^n(n!)^3)
(122)

for m=1 with alternating signs,

(128)/(pi^2)=sum_(n=0)^(infty)((-1)^n(1/2)_n^5(820n^2+180n+13))/(32^(2n)(n!)^5)
(123)
8/(pi^2)=sum_(n=0)^(infty)((-1)^n(1/2)_n^5(20n^2+8n+1))/(2^(2n)(n!)^5)
(124)

for m=2 (Guillera 2002, 2003, 2006),

 (32)/(pi^3)=sum_(n=0)^infty((1/2)_n^7(168n^3+76n^2+14n+1))/(2^(6n)(n!)^7)
(125)

for m=3. The last identity was discovered by B. Gourevitch and reported by Guillera (2003); Au (2025) proved it, and Guillera (2026) gave a simpler proof.

For m=4, J. Cullen (pers. comm., Dec. 8, 2010) discovered the series

 (2048)/(pi^4)=sum_(n=0)^infty((1/2)_n^7(1/4)_n(3/4)_n(43680n^4+20632n^3+4340n^2+466n+21))/(2^(12n)(n!)^9),
(126)

which was proved by Guillera (2026).

Bailey et al. (2007, pp. 45-48) found no additional identities for m=4 or 5 in their restricted search. More general series for 1/pi^4 have since been proved by Au (2025).

Bellard (1997b) found the exotic formula numerically using the PSLQ algorithm

 pi=1/(740025)[sum_(n=1)^infty(3P(n))/((7n; 2n)2^(n-1))-20379280],
(127)

where

 P(n)=-885673181n^5+3125347237n^4-2942969225n^3+1031962795n^2-196882274n+10996648.
(128)

Gasper quotes the result

 pi=(16)/3[lim_(x->infty)x_1F_2(1/2;2,3;-x^2)]^(-1),
(129)

where _1F_2 is a generalized hypergeometric function, and transforms it to

 pi=lim_(x->infty)4x_1F_2(1/2;3/2,3/2;-x^2).
(130)

A fascinating result due to Gosper is given by

 lim_(n->infty)product_(i=n)^(2n)pi/(2tan^(-1)i)=4^(1/pi)=1.554682275....
(131)

pi satisfies the inequality

 (1+1/pi)^(pi+1) approx 3.14097<pi.
(132)

D. Terr (pers. comm.) noted the curious identity

 (3,1,4)=(1,5,9)+(2,6,5) (mod 10)
(133)

involving the first 9 digits of pi.


See also

BBP Formula, Digit-Extraction Algorithm, Newton's Pi Series, Pi, Pi Approximations, Pi Continued Fraction, Pi Digits, Pi Iterations, Pi Squared, Spigot Algorithm

Explore with Wolfram|Alpha

References

Adamchik, V. and Wagon, S. "A Simple Formula for pi." Amer. Math. Monthly 104, 852-855, 1997.Adamchik, V. and Wagon, S. "Pi: A 2000-Year Search Changes Direction." http://www-2.cs.cmu.edu/~adamchik/articles/pi.htm.Au, K. C. "Wilf-Zeilberger Seeds and Non-Trivial Hypergeometric Identities." J. Symbolic Comput. 130, 102421, 2025. https://doi.org/10.1016/j.jsc.2025.102421.Backhouse, N. "Note 79.36. Pancake Functions and Approximations to pi." Math. Gaz. 79, 371-374, 1995.Bailey, D. H. "Numerical Results on the Transcendence of Constants Involving pi, e, and Euler's Constant." Math. Comput. 50, 275-281, 1988a.Bailey, D. H.; Borwein, J. M.; Calkin, N. J.; Girgensohn, R.; Luke, D. R.; and Moll, V. H. Experimental Mathematics in Action. Wellesley, MA: A K Peters, 2007.Bailey, D. H.; Borwein, P.; and Plouffe, S. "On the Rapid Computation of Various Polylogarithmic Constants." Math. Comput. 66, 903-913, 1997.Beck, G. and Trott, M. "Calculating Pi: From Antiquity to Moderns Times." https://reference.wolfram.com/legacy/v5_2/Demos/Notebooks/CalculatingPi.html.Beckmann, P. A History of Pi, 3rd ed. New York: Dorset Press, 1989.Beeler, M.; Gosper, R. W.; and Schroeppel, R. Items 120 and 139 in HAKMEM. Cambridge, MA: MIT Artificial Intelligence Laboratory, Memo AIM-239, Feb. 1972. https://www.inwap.com/pdp10/hbaker/hakmem/series.html#item120 and https://www.inwap.com/pdp10/hbaker/hakmem/pi.html#item139.Bellard, F. "A New Formula to Compute the n'th Binary Digit of Pi." Jan. 20, 1997a. https://bellard.org/pi/pi_bin/pi_bin.html.Bellard, F. "Pi Formulas, Algorithms and Computations." Feb. 4, 1997b. https://bellard.org/pi/.Berndt, B. C. Ramanujan's Notebooks, Part IV. New York: Springer-Verlag, 1994.Beukers, F. "A Rational Approach to pi." Nieuw Arch. Wisk. (5) 1, 372-379, 2000. https://research-portal.uu.nl/ws/files/12134349/372.pdf.Blatner, D. The Joy of Pi. New York: Walker, 1997.Boros, G. and Moll, V. Irresistible Integrals: Symbolics, Analysis and Experiments in the Evaluation of Integrals. Cambridge, England: Cambridge University Press, 2004.Borwein, J. and Bailey, D. Mathematics by Experiment: Plausible Reasoning in the 21st Century. Wellesley, MA: A K Peters, 2003.Borwein, J.; Bailey, D.; and Girgensohn, R. Experimentation in Mathematics: Computational Paths to Discovery. Wellesley, MA: A K Peters, 2004a.Borwein, J. M.; Borwein, D.; and Galway, W. F. "Finding and Excluding b-ary Machin-Type Individual Digit Formulae." Canad. J. Math. 56, 897-925, 2004b. https://doi.org/10.4153/CJM-2004-041-2.Borwein, J. M. and Borwein, P. B. Pi & the AGM: A Study in Analytic Number Theory and Computational Complexity. New York: Wiley, 1987a.Borwein, J. M. and Borwein, P. B. "Ramanujan's Rational and Algebraic Series for 1/pi." J. Indian Math. Soc. 51, 147-160, 1987b. https://www.cecm.sfu.ca/~pborwein/PAPERS/P36.pdf.Borwein, J. M. and Borwein, P. B. "More Ramanujan-Type Series for 1/pi." In Ramanujan Revisited: Proceedings of the Centenary Conference, University of Illinois at Urbana-Champaign, June 1-5, 1987 (Ed. G. E. Andrews, R. A. Askey, B. C. Berndt, K. G. Ramanathan, and R. A. Rankin). Boston, MA: Academic Press, pp. 359-374, 1988.Borwein, J. M. and Borwein, P. B. "Class Number Three Ramanujan Type Series for 1/pi." J. Comput. Appl. Math. 46, 281-290, 1993. https://doi.org/10.1016/0377-0427(93)90302-R.Borwein, J. M.; Borwein, P. B.; and Bailey, D. H. "Ramanujan, Modular Equations, and Approximations to Pi, or How to Compute One Billion Digits of Pi." Amer. Math. Monthly 96, 201-219, 1989.Castellanos, D. "The Ubiquitous Pi. Part I." Math. Mag. 61, 67-98, 1988a.Castellanos, D. "The Ubiquitous Pi. Part II." Math. Mag. 61, 148-163, 1988b.Chudnovsky, D. V. and Chudnovsky, G. V. "Approximations and Complex Multiplication According to Ramanujan." In Ramanujan Revisited: Proceedings of the Centenary Conference, University of Illinois at Urbana-Champaign, June 1-5, 1987 (Ed. G. E. Andrews, R. A. Askey, B. C. Berndt, K. G. Ramanathan, and R. A. Rankin). Boston, MA: Academic Press, pp. 375-472, 1988.Dalzell, D. P. "On 22/7." J. London Math. Soc. 19, 133-134, 1944.Dalzell, D. P. "On 22/7 and 355/113." Eureka 34, 10-13, 1971.Ferguson, H. R. P.; Bailey, D. H.; and Arno, S. "Analysis of PSLQ, An Integer Relation Finding Algorithm." Math. Comput. 68, 351-369, 1999.Finch, S. R. Mathematical Constants. Cambridge, England: Cambridge University Press, 2003.Flajolet, P. and Vardi, I. "Zeta Function Expansions of Classical Constants." Unpublished manuscript. 1996. https://algo.inria.fr/flajolet/Publications/landau.ps.Gasper, G. "Re: confluent pi." math-fun@cs.arizona.edu posting, Aug. 18, 1996.Gosper, R. W. "a product." math-fun@cs.arizona.edu posting, Sept. 27, 1996.Gosper, R. W. math-fun@cs.arizona.edu posting, Sept. 1996.Gourdon, X. and Sebah, P. "Collection of Series for pi." http://numbers.computation.free.fr/Constants/Pi/piSeries.html.Guillera, J. "Some Binomial Series Obtained by the WZ-Method." Adv. Appl. Math. 29, 599-603, 2002.Guillera, J. "About a New Kind of Ramanujan-Type Series." Exp. Math. 12, 507-510, 2003. https://doi.org/10.1080/10586458.2003.10504518.Guillera, J. "Generators of Some Ramanujan Formulas." Ramanujan J. 11, 41-48, 2006.Guillera, J. "The WZ Method and Flawless WZ Pairs." Bull. Austral. Math. Soc. 113, 152-160, 2026. https://doi.org/10.1017/S0004972725000231.Hakimoglu-Brown, C. "Accelerating the Hypergeometric Function with the Beta Integral to Derive New Infinite Series for pi and Values of the Gamma Function." 12 Feb 2024. https://arxiv.org/abs/2402.08693.Hardy, G. H. "A Chapter from Ramanujan's Note-Book." Proc. Cambridge Philos. Soc. 21, 492-503, 1923.Hardy, G. H. "Some Formulae of Ramanujan." Proc. London Math. Soc. (Records of Proceedings at Meetings) 22, xii-xiii, 1924.Hardy, G. H. Ramanujan: Twelve Lectures on Subjects Suggested by His Life and Work, 3rd ed. New York: Chelsea, 1999.Knopp, K. Theory and Application of Infinite Series. New York: Dover, 1990.Le Lionnais, F. Les nombres remarquables. Paris, France: Hermann, 1983.Lucas, S. K. "Integral Proofs that 355/113>pi." Austral. Math. Soc. Gaz. 32, 263-266, 2005.Lucas, S. K. "Approximations to pi Derived from Integrals with Nonnegative Integrands." Amer. Math. Monthly 116, 166-172, 2009. https://doi.org/10.1080/00029890.2009.11920923.MathPages. "Rounding Up to Pi." https://www.mathpages.com/home/kmath001/kmath001.htm.Pardeshi, C. "Pi in Golden Ratio Base Phi." May 2022. https://oeis.org/A000796/a000796.pdf.Plouffe, S. "Identities Inspired from Ramanujan Notebooks (Part 2)." Apr. 2006. https://www.plouffe.fr/simon/inspired2.pdf.Plouffe, S. "A Formula for the n'th Decimal Digit or Binary of pi and pi^n." 29 Jan 2022. https://arxiv.org/abs/2201.12601.Rabinowitz, S. and Wagon, S. "A Spigot Algorithm for the Digits of pi." Amer. Math. Monthly 102, 195-203, 1995.Ramanujan, S. "Modular Equations and Approximations to pi." Quart. J. Pure. Appl. Math. 45, 350-372, 1913-1914.Rudio, F. "Ueber die Convergenz einer von Vieta herrührenden eigenthümlichen Productentwickelung." Z. Math. Phys. (Historisch-literarische Abtheilung) 36, 139-140, 1891. https://resolver.sub.uni-goettingen.de/purl?PPN599415665_0036.Sloane, N. J. A. Sequences A054387 and A054388 in "The On-Line Encyclopedia of Integer Sequences."Smith, D. History of Mathematics, Vol. 2. New York: Dover, 1953.Sondow, J. "Problem 88." Math Horizons, pp. 32 and 34, Sept. 1997.Sondow, J. "A Faster Product for pi and a New Integral for ln(pi/2)." Amer. Math. Monthly 112, 729-734, 2005.Sun, Z.-W. "Evaluations of Some Series of the Type sum_(k=0)^(infty)(ak+b)x^k/(mk; nk)." Nanjing Univ. J. Math. Biquarterly 41, 1-33, 2024. https://arxiv.org/abs/2204.08275.Vardi, I. Computational Recreations in Mathematica. Reading, MA: Addison-Wesley, p. 159, 1991.Veritasium. "The Discovery That Transformed Pi." Mar. 16, 2021. https://www.youtube.com/watch?v=gMlf1ELvRzc.Vieta, F. Uriorum de rebus mathematicis responsorum. Liber VII. 1593. Reprinted in New York: Georg Olms, pp. 398-400 and 436-446, 1970.Wells, D. The Penguin Dictionary of Curious and Interesting Numbers. Middlesex, England: Penguin Books, 1986.Wolfram Research, Inc. "Some Notes on Internal Implementation: Mathematical Constants." https://reference.wolfram.com/language/tutorial/SomeNotesOnInternalImplementation.html.

Referenced on Wolfram|Alpha

Pi Formulas

Cite this as:

Weisstein, Eric W. "Pi Formulas." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/PiFormulas.html

Subject classifications