Connect via MCP →

Enter Calculation

Formula

Formula: Pi (π) Calculator Using Japanese Wasan Scholar Formulas
Show calculation steps (1)
  1. Takebe Katahiro (1722)

    Takebe Katahiro (1722): Pi (π) Calculator Using Japanese Wasan Scholar Formulas

    Series converging to pi^2/9; the k-th term has numerator (k!)^2 over a product of consecutive integers from 3. pi = 3 times the square root of the sum.

Advertisement

Results

Approximation of pi
3.141592653589794
summed over 100 terms
Series sum value 1.047197551196598
Number of terms 100
Requested display digits 26
This snippet uses double-precision floating point, so accuracy plateaus around 15-16 significant digits regardless of the chosen display digits. Reproducing the historical 41- or 52-digit results of Takebe Katahiro and Matsunaga Yoshisuke would require arbitrary-precision arithmetic.

What this calculator does

This tool approximates the mathematical constant pi by summing one of two historical series developed by Japanese "wasan" (traditional Japanese mathematics) scholars. You can choose the series of Takebe Katahiro (1722), which converges to pi-squared over nine, or the series of Matsunaga Yoshisuke (1739), which converges to pi over three. While the historical framing is Japanese, the underlying series are pure, universal mathematics and converge to pi everywhere.

How to use it

Pick a formula from the dropdown, enter the number of terms N to sum (more terms means a more accurate result), and choose how many digits to display. The calculator returns the pi approximation plus the raw series sum so you can verify the intermediate value (pi/3 for Matsunaga, pi-squared/9 for Takebe).

The formula explained

For Matsunaga, each successive term multiplies the previous one by (2k-1) squared and divides by 4k times (4k+2); the running sum S gives pi = 3S. For Takebe, each term multiplies by k squared and divides by (2k+1)(2k+2); the running sum gives pi = 3 times the square root of S. Using these incremental recurrences avoids computing enormous factorials and prevents overflow.

$$\frac{\pi}{3} = 1 + \frac{1^2}{4\cdot6} + \frac{1^2\cdot3^2}{4\cdot6\cdot8\cdot10} + \cdots$$$$\frac{\pi}{3} = \sum_{k=0}^{N-1} \frac{((2k-1)!!)^2}{4\cdot6\cdots(4k+2)}$$$$\frac{\pi^2}{9} = \sum_{k=0}^{N-1} \frac{(k!)^2}{3\cdot4\cdots(2k+2)}$$
Diagram of a series sum with successive terms shrinking toward a fixed total
Each added term in the wasan series is smaller, so the partial sum converges toward pi.

Worked example

Matsunaga with N = 4 terms:

$$1 + \frac{1}{24} + \frac{9}{1920} + \frac{225}{322560} = 1.0470517113$$

so pi is approximately

$$3 \times 1.0470517113 = 3.1411551340.$$

With 100 terms the result reaches full double-precision accuracy, about \(3.14159265358979\).

Stacked partial sums of the series getting closer to a horizontal pi line
Partial sums (1 term, 2 terms, 3 terms...) climb toward the value of pi.

FAQ

Why does adding more digits not improve accuracy? This runs in double-precision arithmetic, which is limited to roughly 15-16 significant digits. The historical 41- and 52-digit feats of Takebe and Matsunaga require arbitrary-precision (BigDecimal) math.

What if I enter 1 term? The series returns only the leading 1, so both formulas give pi approximately 3.

Which series converges faster? Both converge steadily; in practice a few hundred terms is enough to reach the limit of double precision.

Last updated: