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)}$$
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\).
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.