Ramanujan Pi Series Calculator

Ramanujan Pi Series Calculator

Growing AI Skill PRO

Enter Calculation

Formula

1π=229801∑n=0Terms−1(4n)!(1103+26390n)(4nn!)4994n\frac{1}{\pi} = \frac{2\sqrt{2}}{9801} \sum_{n=0}^{\text{Terms}-1} \frac{(4n)!\,(1103 + 26390\,n)}{(4^{n}\,n!)^{4}\,99^{4n}}
Usage stats

Advertisement

Results

Value of Pi
3.141592653589793
approximation of the constant pi
Terms summed 4
Requested display digits 46

Report an error on this page

What this calculator does

This tool computes the mathematical constant pi by summing one of three famous rapidly-converging infinite series term by term: Ramanujan's first 1914 series, Ramanujan's second 1914 series, or the Chudnovsky brothers' 1987 series. These series are remarkable because each added term contributes many correct decimal digits at once, so just a handful of terms reproduce pi to full double-precision accuracy. This is pure mathematics and applies universally with no regional rules.

How to use it

Pick a formula from the dropdown, set the maximum number of terms to add, and choose how many decimal digits to display. The calculator adds terms n = 0, 1, 2, ... and stops early once the running value of pi no longer changes, which usually happens within a few terms. Because the engine uses IEEE-754 double arithmetic, about 15-16 significant digits are reliably accurate regardless of the display setting.

The formula explained

Ramanujan 1 builds the reciprocal of pi: a constant prefactor \(\frac{\sqrt{8}}{9801}\) multiplies an infinite sum whose nth term combines the factorial ratio \(\frac{(4n)!}{(4^n n!)^4}\) with the linear factor \((1103 + 26390n)\) divided by \(99^{4n}\). The full series is $$\frac{1}{\pi} = \frac{\sqrt{8}}{9801} \sum_{n=0}^{\infty} \frac{(4n)!}{(4^n n!)^4} \cdot \frac{1103 + 26390n}{99^{4n}}$$ Once the sum \(S\) is known, pi is recovered as \(\frac{1}{\text{prefactor} \times S}\). Chudnovsky works similarly but converges even faster, adding roughly 14 digits per term: $$\frac{1}{\pi} = 12 \sum_{n=0}^{\infty} \frac{(-1)^n (6n)!\,(13591409 + 545140134n)}{(3n)!\,(n!)^3\,(640320^3)^{n+1/2}}$$

Advertisement
Diagram of Ramanujan's series terms shrinking and summing toward a target value
Each term of Ramanujan's series adds about eight more correct digits, rapidly approaching \(\frac{1}{\pi}\).

Computed with IEEE-754 double precision, so about 15-16 significant digits are reliable. Requesting more display digits does not increase the underlying accuracy unless arbitrary-precision arithmetic is used.

Worked example

Using Ramanujan 1 with only the n=0 term: the prefactor is \(\frac{\sqrt{8}}{9801} = 0.000288583\ldots\), and the n=0 term is \(1 \times 1103 = 1103\). So $$\frac{1}{\pi} = 0.000288583 \times 1103 = 0.31831\ldots,$$ giving \(\pi = 3.14159273\), already correct to about six decimals. Adding the n=1 term brings pi to \(\pi = 3.14159265358979\), correct to roughly 16 digits.

Flat bar chart comparing convergence speed of leibniz, ramanujan and chudnovsky series
Correct digits of pi gained per term: Leibniz is slow, Ramanujan adds ~8, Chudnovsky ~14.

Convergence Comparison: Ramanujan 1 vs Ramanujan 2 vs Chudnovsky

Each added term of a Ramanujan-type series contributes a fixed number of correct digits of \(\pi\). Ramanujan's 1914 series (formula 1) adds about 8 digits per term, and the Chudnovsky series adds about 14 digits per term. The table gives approximate correct digits after n terms, and the n=1 row shows the value of \(\pi\) from the first term alone.

Terms (n) Ramanujan 1 (1103 + 26390n) Chudnovsky Ramanujan 2 (as implemented)
1 ≈ 7–8 digits: 3.14159273 (the first 7 digits, 3.141592, are correct) ≈ 14 digits: 3.14159265358973 (13 decimals correct) Slower-converging series; see the calculator's output for the exact value
2 ≈ 15–16 digits (reaches double-precision limit) ≈ 28 digits (beyond double precision) Roughly double the n=1 digit count
3 ≈ 24 digits (beyond double precision) ≈ 42 digits (beyond double precision) Roughly triple the n=1 digit count

Double-precision saturation: standard 64-bit floating-point numbers hold only about 15–16 significant decimal digits. In plain double arithmetic, Ramanujan 1 reaches that limit at about 2 terms and Chudnovsky at 2 terms or fewer, so extra terms change nothing in the displayed result. Digits past about 16 need arbitrary-precision arithmetic.

The digit counts per term are approximations. The Ramanujan 2 column depends on which series the tool implements, so compare it with the calculator's own output rather than relying on these estimates.

Advertisement

Constants Used in the Series

These fixed values appear in the two series.

  • Ramanujan prefactor: \(\dfrac{2\sqrt{2}}{9801} = \dfrac{\sqrt{8}}{9801} \approx 2.8859 \times 10^{-4}\), where \(\sqrt{8} \approx 2.8284271247\).
  • Linear term constants: 1103 and 26390, which give the factor \(1103 + 26390\,n\).
  • Denominator base: \(99^4 = 96059601\), since \(99^2 = 9801\) and \(9801^2 = 96059601\). The denominator \((4^n n!)^4\,99^{4n}\) equals \((n!)^4\,396^{4n}\), because \(4 \times 99 = 396\).
  • Chudnovsky linear constants: 13591409 and 545140134, which give the factor \(13591409 + 545140134\,k\).
  • Chudnovsky base: 640320, with \(640320^3 = 262537412640768000\). The series uses \(640320^{3/2} \approx 5.1238 \times 10^{8}\). This is equivalent to the prefactor \(426880\sqrt{10005}\) in the common form \(\pi = 426880\sqrt{10005} \big/ \sum_k \dfrac{(6k)!\,(13591409 + 545140134\,k)}{(3k)!\,(k!)^3\,(-640320)^{3k}}\).
  • Reference value: \(\pi = 3.14159265358979323846\ldots\)

FAQ

Why does increasing the digits dropdown not show more accuracy? Double-precision floating point only carries about 15-16 significant digits; reaching more requires arbitrary-precision arithmetic.

How many terms do I really need? For full double precision, Ramanujan 1 needs about 2 terms and Chudnovsky just 1-2 terms.

Which series is fastest? Chudnovsky converges fastest and is the algorithm used for modern record pi computations.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators