This guide describes all 83 calculators in WASAN. It uses the same descriptions, input guidance, and precision labels as the interactive site. You do not need JavaScript to read it.
The reference follows the same six-chapter learning path as the interactive laboratory. The chapter order is for learning, not a historical timeline.
Look-and-Say and the Collatz Conjecture are explicitly modern comparison material, not historical wasan. To run a calculation, follow a calculator link and enable JavaScript. This reference does not execute calculations and is not a server-side calculation API.
Chapter 1 · Foundations
01. Cranes and Turtles
Separate two populations from heads and legs
Use the total number of heads and legs to recover the two populations exactly.
Result
Numbers of cranes and turtles (Exact integer calculation)
Formula
turtles = (legs − 2 × heads) / 2
Method
Subtract twice the number of heads from the leg count, divide by two for turtles, and take the remainder as cranes.
Conditions
The crane and turtle counts must be non-negative integers. The total leg count minus twice the head count must be even.
Historical position
Tsurukamezan is a classic East Asian problem type. The method illustrates linear equations without requiring symbolic notation.
Inputs
Total heads: default 10 — A non-negative integer of up to 80 digits.
Total legs: default 28 — An even integer between twice and four times the number of heads.
Given three unmarked vessels, find a shortest sequence of legal pours that measures the target amount.
Result
Minimum number of pours (Shortest sequence, integer states)
Formula
amount poured = min(source amount, free capacity at destination)
Method
A breadth-first search explores every allowed pour between vessels until the target amount is reached.
Conditions
Capacities and target must be integers in range. No sequence exists if the target is not a multiple of the greatest common divisor of the vessel capacities.
Historical position
Oil-measuring problems appear in Japanese recreational arithmetic as practical measurement puzzles.
Inputs
Capacity of vessel A (initially full): default 10 — Each vessel capacity must be an integer from 1 to 100, measured in the same unit.
Capacity of vessel B: default 7
Capacity of vessel C: default 3
Amount to measure: default 5 — An integer from 1 through the capacity of vessel A.
Bring down the radicand two digits at a time and choose each new digit without using a floating-point square-root function.
Result
Square root √N (Exact digits and bounds)
Formula
(20p + q)q ≤ the current remainder after bringing down the next two-digit group; q ∈ {0, …, 9}
Method
If p is the root found so far, choose the largest digit q for which (20p+q)q does not exceed the current remainder after bringing down the next two-digit group.
Conditions
The result is truncated, not rounded. Inputs must be non-negative decimal numbers; complex roots and scientific notation are outside this tool.
Historical position
This is a teaching implementation of the digit-by-digit root extraction used in wasan and elsewhere; it is not presented as an exclusively Japanese invention.
Inputs
Number N: default 2 — A non-negative integer or decimal, no more than 160 characters; scientific notation is not accepted.
Calculate the hypotenuse from the two perpendicular sides.
Result
Hypotenuse c (Approximate square root)
Formula
c² = a² + b²
Method
Form a²+b² and take its non-negative square root.
Conditions
Both legs must be positive and use the same unit. The displayed square root is a decimal approximation unless it is exact.
Historical position
The traditional terms kō and ko name the two legs of a right triangle. The relation itself belongs to the wider East Asian mathematical tradition and is not unique to Japan.
Inputs
Leg kō, a: default 3 — A decimal from 0.000001 to 1,000,000, no more than 30 characters.
Find the least non-negative integer that satisfies several remainder conditions, together with the period of all solutions.
Result
Least non-negative integer satisfying the conditions (Exact large-integer arithmetic)
Formula
x ≡ r₁ (mod m₁), x ≡ r₂ (mod m₂), …
Method
Conditions are merged one row at a time with greatest common divisors and the extended Euclidean algorithm.
Conditions
Moduli need not be coprime, but incompatible conditions have no solution. Every remainder is normalized before calculation.
Historical position
The classic moduli 3, 5, and 7 come from the Chinese Remainder Problem and were also studied in wasan; arbitrary moduli are a modern extension.
Inputs
Modulus and remainder, one pair per line: default 3, 2
5, 3
7, 2 — Enter 1–10 rows. Each modulus must be at least 2; integers may contain up to 80 digits.
From the triangular sum 1+2+…+n to sums of fifth powers, evaluate a whole stack exactly from its base size instead of counting layer by layer.
Result
1ᵖ + 2ᵖ + … + nᵖ (Exact integer calculation)
Formula
Σ kᵖ (p=1,…,5)
Method
For powers 1 through 5, evaluate closed-form power-sum formulas with BigInt arithmetic. The table shows selected levels and cumulative totals for inspection.
Conditions
n must be non-negative. The formulas are implemented in modern notation; this calculator does not reenact the historical counting-rod or tenzan procedures.
Historical position
Wasan developed methods for stacked sums (daseki). A modern commentary on Sanpō Tenzan Shinanroku discusses square and cubic stacks, including a cubic-stack example with base size 5 and total 225. This tool presents those cases in the unified modern language of power sums.
Inputs
Base size n: default 10 — A non-negative integer of up to 80 digits.
Power on each level: default 1 — Powers 1 through 5.
Unify triangular, pentagonal and hexagonal numbers
Triangular, square, pentagonal, hexagonal and higher polygonal numbers all follow one rule. Compute any term exactly for k from 3 through 30.
Result
The nth k-gonal number (Exact integer calculation)
Formula
Pₖ(n)=((k−2)n²−(k−4)n)/2
Method
Evaluate the modern general polygonal-number formula using exact integer arithmetic.
Conditions
k must be from 3 through 30 and n must be non-negative. Treating every case as a single family of “k-gonal numbers” is a modern organization; this page does not claim that Edo-period wasan used the same terminology or unified all k in this way.
Historical position
Wasan includes studies of stacked sums and regular polygons, both of which connect numerical patterns with geometry. This page connects those themes to the modern theory of polygonal numbers.
Inputs
Polygon order k: default 5 — 3 = triangular, 5 = pentagonal, 6 = hexagonal; choose a value from 3 through 30.
Term index n: default 10 — A non-negative integer of up to 60 digits.
Compute n!, nPr and nCr from the same inputs. Modern notation is used here to present counting ideas that also appear in wasan.
Result
n!, nPr and nCr (Exact integer calculation)
Formula
nPr=n!/(n−r)! / nCr=n!/(r!(n−r)!)
Method
Compute factorials, permutations and binomial coefficients exactly with BigInt arithmetic.
Conditions
0≤n≤500 and 0≤r≤n. The symbols n!, nPr and nCr are modern notation, not transcriptions of historical wasan notation.
Historical position
Wasan includes work corresponding to permutations, combinations and other counting problems. This page presents those ideas using modern factorial, permutation and combination notation.
Inputs
Total number n: default 10 — An integer from 0 through 500.
Number selected r: default 3 — An integer from 0 through n.
Enumerate every r-element selection from n objects, then verify that the total agrees with nCr.
Result
Number of choices enumerated (All candidates enumerated exactly)
Formula
enumerated count = C(n,r)
Method
Generate combinations in increasing order by depth-first enumeration, then verify the final count against the binomial coefficient.
Conditions
n≤10. This combination enumerator is a modern teaching model of chikusaku-style exhaustive search; it is not a line-by-line reconstruction of a particular problem from Sanpō Chikusakujutsu.
Historical position
Wasan includes a family of exhaustive-search and counting methods called chikusakujutsu. Surviving works include Aida Yasuaki’s Sanpō Chikusakujutsu and the manuscript Chikusaku Kihō.
Inputs
Number of objects n: default 5 — An integer from 1 through 10.
Number selected r: default 3 — An integer from 0 through n.
Compute Bₙ, the number of ways to partition n distinct objects into nonempty unlabeled groups. For n=5, the answer is 52.
Result
Bell number Bₙ (Exact integer calculation)
Formula
Bₙ₊₁=Σₖ C(n,k)Bₖ
Method
Starting with B₀=1, use the binomial-coefficient recurrence to compute successive Bell numbers exactly with BigInt arithmetic.
Conditions
n≤30. “Bell number” and the symbol Bₙ are modern terminology; this page does not claim that Edo-period sources used that name.
Historical position
Later scholarship has compared counting results in wasan, including work by Matsunaga Yoshisuke, with the sequence now called the Bell numbers. The 52 Genjikō patterns record which of five incense samples are judged to have the same scent.
Inputs
Number of objects n: default 5 — An integer from 0 through 30.
Compute Stirling numbers of the second kind S(n,k) and unsigned Stirling numbers of the first kind c(n,k) exactly by recurrence.
Result
Stirling number (Exact integer calculation)
Formula
S(n,k)=S(n−1,k−1)+kS(n−1,k)
Method
Build the triangular table from the boundary value (0,0)=1. The unsigned first kind uses its own recurrence.
Conditions
n≤25. The name “Stirling number” and the symbols used here are modern. Equivalences with historical wasan sequences are presented as comparisons made by later scholarship.
Historical position
Later researchers studying wasan combinatorics have identified correspondences between results by practitioners such as Saka Masanaga and results that can now be expressed in terms of Stirling numbers.
Inputs
n: default 5 — An integer from 0 through 25.
k: default 2 — An integer from 0 through n.
Kind: default Second kind — Second kind = set partitions into exactly k blocks; unsigned first kind = permutations with exactly k cycles.
Factor an integer into primes and list all primes up to a chosen limit. This modern implementation is presented alongside wasan work on jiyaku and prime numbers.
Result
Prime factorization of N (Exact integer calculation)
Formula
N=∏pᵉ
Method
Use modern trial division by 2, 3 and then candidates of the form 6m±1, plus a sieve for the prime list. This is not a reconstruction of the historical jiyaku procedure.
Conditions
The integer to factor must be from 2 through 1 trillion; the prime-list limit is at most 5,000. This is not a general high-performance factorization engine for arbitrarily large integers.
Historical position
Wasan sources and later scholarship discuss jiyaku in connection with factorization and prime numbers. Modern studies examine sources including Matsunaga Yoshisuke’s Sanpō Ruijū.
Inputs
Integer N to factor: default 360 — An integer from 2 through 1 trillion.
Prime-list upper limit: default 100 — An integer from 2 through 5,000.
Use a sieve to count the primes from 2 through N and compute the prime-counting function π(N) exactly.
Result
π(N) — number of primes at most N (Exact integer calculation)
Formula
π(N)=#{p≤N : p is prime}
Method
Use the Sieve of Eratosthenes to mark composites and count the remaining primes up to N.
Conditions
N must not exceed 5,000,000. This is a modern sieve implementation, not a reconstruction of Kurushima’s historical procedure.
Historical position
Kurushima Yoshihiro’s surviving work includes questions related to primes and number theory. Later scholarship has also discussed his work in relation to counting primes. This calculator expresses that question with the modern notation π(N).
Inputs
Upper limit N: default 1000 — An integer from 0 through 5,000,000.
Use the prime factorization of N to count the positive integers from 1 through N that are coprime to it.
Result
φ(N) (Exact integer calculation)
Formula
φ(N)=N∏ₚ|N(1−1/p)
Method
Factor N and, for each distinct prime factor p, update the count by multiplying by (p−1)/p.
Conditions
1≤N≤1 trillion, with φ(1)=1. The symbol φ and the product formula are modern notation.
Historical position
Later scholarship has compared a result in Kurushima Yoshihiro’s Kyūshi Ikō with Euler’s totient function; the correspondence is sometimes discussed under the label “Kurushima–Euler function.” This page separates the Japanese manuscript tradition from the European publication history rather than reducing the question to a simple priority claim.
Inputs
Integer N: default 36 — An integer from 1 through 1 trillion.
Move from the triangular stack 1+2+…+n to exact sums of powers as high as the twelfth.
Result
1ᵖ + 2ᵖ + … + nᵖ (Exact integer calculation)
Formula
S(n) = Σ ΔᵏS(0) · C(n, k)
Method
Form cumulative sums from S(0)=0, take forward differences, and evaluate the resulting Newton-series expression exactly.
Conditions
n must be a non-negative integer and p an integer from 0 through 12. The broader power-sum treatment is a pedagogical extension of the stacking problem.
Historical position
Tawara-sugi problems count bales arranged in triangular stacks. This tool uses that familiar entry point to explore the wider mathematics of power sums.
Inputs
Upper summation limit n: default 100 — A non-negative integer of up to 80 digits.
Build successive finite differences from values at equally spaced x-coordinates, then evaluate the unique interpolating polynomial.
Result
Interpolating polynomial value P(x) (Exact rational arithmetic)
Formula
P(x) = Σ C(t, k) Δᵏy₀; t = (x − x₀) / h
Method
Multiply the first entry in each difference row by the generalized binomial coefficient C(t,k), then add the terms exactly as rational numbers.
Conditions
With n observations this chooses the polynomial of degree at most n−1 through those points. It does not prove that the underlying phenomenon is polynomial, and extrapolation needs care.
Historical position
Shosaho grew from East Asian calendrical interpolation and was developed within wasan. The forward-difference notation used here is modern.
Inputs
Known values y₀, y₁, …: default 0, 1, 4, 9, 16 — Enter 2–12 comma-separated values; fractions are accepted.
Starting position x₀: default 0
Step size h: default 1
Target position x: default 5 — For example: 5, 0.5, or 1/2.
For n distinct x-values, construct the unique polynomial of degree at most 2n−1 that matches the supplied values and first derivatives.
Result
Value of the interpolating polynomial (Exact rational arithmetic)
Formula
P(xᵢ)=yᵢ, P′(xᵢ)=mᵢ; degree ≤ 2n−1
Method
Construct Hermite basis polynomials for the values and slopes, then combine and evaluate them in exact rational arithmetic.
Conditions
x-values must be distinct. The resulting degree is at most 2n−1 and does not guarantee behavior between or beyond the conditions.
Historical position
This modern extension lets visitors compare ordinary difference interpolation with a problem that also fixes slopes.
Inputs
Conditions, one x,value,slope row per line: default 0,1,0
2,9,12 — Enter 2–6 rows. Each value may contain up to 24 characters and have absolute value at most 1,000,000; decimals and fractions are accepted. Total input is limited to 1,400 characters.
Evaluation point x: default 1 — Up to 24 characters, with absolute value at most 1,000,000.
Evaluate distant terms without computing every step
Evaluate a constant-coefficient linear recurrence at a very large index, optionally modulo an integer.
Result
Value of the requested term (Exact integer arithmetic)
Formula
a(n)=c₁a(n−1)+…+c_d a(n−d)
Method
Use binary exponentiation modulo the recurrence’s characteristic polynomial, then combine the initial values with the resulting coefficients.
Conditions
Coefficients and initial values must be integers with absolute value at most 1,000,000. Indices start at 0. With modulus 0, calculation stops if an intermediate integer exceeds approximately 1,200 decimal digits. A positive modulus returns a non-negative remainder.
Historical position
This modern algorithm extends the geometric-growth idea of nezumizan to general linear recurrences.
Inputs
Recurrence coefficients c₁,c₂,…: default 1,1 — Enter 1–8 integers, each of up to 24 characters and absolute value at most 1,000,000.
Initial values a(0),a(1),…: default 0,1 — Enter the same number of integers as recurrence coefficients; each has the same size limits.
Term index n: default 50 — An integer from 0 to 1,000,000,000,000.
Modulus (0 for exact arithmetic): default 0 — An integer from 0 through 1,000,000,000,000,000,000.
Read each run of identical digits as “how many, then which digit” and use that description as the next string.
Result
Final look-and-say string (Modern sequence — not historical wasan)
Formula
111221 → “three 1s, two 2s, one 1” → 312211
Method
Scan left to right, count each maximal run of equal digits, and replace it with “count + digit.”
Conditions
This is not historical wasan. A finite computation here is neither evidence that wasan practitioners studied this sequence nor a proof of any general property.
Historical position
The look-and-say sequence belongs to modern mathematics. It appears here in a clearly separate comparison section: a contemporary example of starting from computed terms and looking for structure, not a historical continuation claim.
Start with a positive integer. If it is even, divide by 2; if it is odd, replace it by 3n+1. Trace a finite orbit exactly and report its peak and the number of steps needed to reach 1.
Result
Orbit to 1 or cutoff result (Modern open problem — not historical wasan)
Formula
n→n/2 (even) / 3n+1 (odd)
Method
Use BigInt arithmetic to follow the orbit for a finite number of steps. If 1 is reached, record the number of steps and the largest value encountered.
Conditions
This is not historical wasan. Reaching 1 for finitely many inputs does not prove the conjecture, and failure to reach 1 before the selected cutoff is not necessarily a counterexample.
Historical position
The Collatz conjecture is a twentieth-century open problem in modern mathematics. Because accounts of its precise early history vary, this page makes no claim of historical continuity with Edo-period mathematics. It is included to illustrate the difference between computation, pattern finding and proof.
Inputs
Starting value n: default 27 — A positive integer of up to 100 digits.
Maximum number of steps: default 1000 — Stop the calculation at this many steps.
Enter a one-variable polynomial by its coefficients and locate one real root inside a chosen interval.
Result
A real root x in the specified interval (Modern root-finding aid)
Formula
Bisect an interval whose endpoint values have opposite signs
Method
The historical coefficient idea is paired with modern bisection. Each midpoint and function value is retained for inspection.
Conditions
Except when an endpoint is already a root, the endpoint values must have opposite signs. It finds one real root, not all roots. Repeated roots may be missed; complex roots are not supported.
Historical position
Tengenjutsu, transmitted from Chinese mathematics, is a method for equations in one unknown. Numerical bisection is clearly separated here as a modern aid.
Inputs
Coefficients, highest degree first: default 1, 0, -2 — For x²−2=0, enter 1, 0, -2. Degree 1–8; each coefficient must be no greater than 10⁶ in absolute value.
Construct the elimination expression and verify it against the corresponding Sylvester determinant.
Conditions
The entered coefficient rows are limited to the documented degrees and integer size. The resulting equation is necessary and may include extraneous branches.
Historical position
In Seki’s work, determinant-like arrays served elimination rather than an abstract theory of determinants. This screen keeps that purpose in view.
Inputs
Coefficients of A(x): default 0 — Enter coefficients from highest degree downward. Degree 2 or less; integer coefficients from −1000 to 1000.
Coefficients of B(x): default -1, 0 — For example, 1, 0, −2 represents x²−2.
Solve a system of linear equations by exact rational row reduction.
Result
Solution of the system (Exact rational arithmetic)
Formula
Choose a pivot row and eliminate that unknown from every other row
Method
Reduce the augmented matrix to reduced row-echelon form using exact rational arithmetic, then describe the unique solution, free-variable family, or inconsistency.
Conditions
The matrix format is one equation per line with the constant on the right. Singular systems are reported rather than forced into a unique answer.
Historical position
This is a modern generalization of elimination ideas that appear throughout East Asian algebra.
Inputs
Augmented matrix, one equation per line: default 1, 1, 1, 6
2, -1, 1, 3
1, 2, -1, 2 — Enter 2–6 rows. Each row lists the coefficients of x₁, x₂, … followed by the right-hand side. Each value may contain up to 24 characters and have absolute value at most 1,000,000.
Count the distinct real roots of an integer polynomial and enclose each one in a rational interval.
Result
Number and locations of real roots (Exact root counts and multiplicities)
Formula
number of real roots = V(a) − V(b) on (a,b]
Method
Use square-free decomposition and Sturm sequences, then bisect rational intervals to the requested display scale.
Conditions
Coefficients must be integers within the stated bounds. Decimal midpoints are guides; the rational intervals and multiplicities carry the certification.
Historical position
This is a modern exact companion to historical equation work, not a claim that wasan writers used Sturm’s theorem.
Inputs
Coefficients, highest degree first: default 1, -2, -3, 4, 4 — Degree 1–8, highest degree first; each integer coefficient must have absolute value at most 10¹⁸.
Calculate the discriminant exactly from a polynomial and its derivative.
Result
Discriminant D, using the modern sign convention (Exact rational arithmetic)
Formula
D = (−1)^(n(n−1)/2) Res(f,f′) / aₙ
Method
Form the exact Sylvester resultant and apply the standard modern sign and leading-coefficient normalization.
Conditions
The reported sign convention is modern and explicitly stated. A zero discriminant certifies repetition; a nonzero value does not locate the roots.
Historical position
Discriminants are used here as a modern continuation of elimination, not as terminology assigned retroactively to every historical array method.
Inputs
Coefficients: default 1, 0, -10, 0, 9 — Highest degree first; degree 1–8. Each value may contain up to 24 characters and have absolute value at most 1,000,000.
Compute the monic greatest common divisor of two polynomials with rational coefficients.
Result
Monic greatest common divisor (Exact rational arithmetic)
Formula
gcd(f,g) = gcd(g, remainder of f divided by g)
Method
Run the Euclidean algorithm over rational coefficients and normalize the final nonzero polynomial to leading coefficient one.
Conditions
Both inputs must satisfy the degree and coefficient bounds. The zero-polynomial cases follow the standard gcd convention.
Historical position
This modern algebraic tool supports elimination and repeated-root analysis used elsewhere in the site.
Inputs
Polynomial f: default 1, 0, -1 — Highest degree first; degree at most 12. Each value may contain up to 24 characters and have absolute value at most 1,000,000; decimals and fractions are accepted.
Polynomial g: default 1, -2, 1 — Highest degree first; degree at most 12. Each value may contain up to 24 characters and have absolute value at most 1,000,000; decimals and fractions are accepted.
Decompose a polynomial into factors that occur once, twice, three times, and so on.
Result
Product of factors grouped by multiplicity (Exact rational arithmetic)
Formula
f = leading coefficient × F₁ × F₂² × F₃³ × …
Method
Apply Yun’s exact square-free algorithm and normalize the factors over the rationals.
Conditions
The tool separates multiplicities but does not necessarily split each square-free factor into irreducibles.
Historical position
This modern algebraic tool supports the certified root and discriminant screens.
Inputs
Coefficients: default 1,1,-5,-1,8,-4 — Highest degree first; degree 1–12. Each value may contain up to 24 characters and have absolute value at most 1,000,000.
Use Seki-style replacement with symbolic coefficients
Apply polynomial replacement steps to eliminate y from two bivariate equations.
Result
Necessary condition after eliminating y (Two determinants compared exactly)
Formula
h₁=bₘf−aₙy^(n−m)g; det H=(−1)^(nm) Resᵧ(f,g)
Method
Perform exact pseudo-remainder steps and compare the final condition with the Sylvester resultant.
Conditions
The displayed resultant is a necessary elimination condition; substitution back into both equations remains essential.
Historical position
The presentation connects Seki’s replacement procedures with modern resultant language while keeping the two viewpoints distinct.
Inputs
First polynomial f: default 1
0
0
-1, 0 — Enter one coefficient row for each power of y, highest first; within a row, list powers of x highest first. The example represents y³−x.
Second polynomial g: default 1
0
-1 — Each row may be quadratic in x, with integer coefficients from −1000 to 1000. The example represents y²−1.
Substitute x=u+h and calculate every new coefficient exactly.
Result
Polynomial f(u+h) (Exact rational arithmetic)
Formula
f(u+h) = Σ bₖuᵏ
Method
Expand each power with binomial coefficients and collect equal powers of u in rational arithmetic.
Conditions
For a nonzero polynomial, translation preserves the degree and leading coefficient; it changes coordinates, not the roots’ relative structure.
Historical position
Changing the unknown’s origin is a natural companion to coefficient-based equation methods such as tengenjutsu.
Inputs
Original polynomial coefficients: default 1, 2, 0, -3, 5 — Highest degree first; degree at most 12. Each value may contain up to 24 characters and have absolute value at most 1,000,000; decimals and fractions are accepted.
Shift h: default 1/2 — Up to 24 characters, with absolute value at most 1,000,000.
Find successive sums of powers of all roots, counted with multiplicity.
Result
Power sums of all roots, counted with multiplicity (Exact rational arithmetic)
Formula
Sₖ+a₁Sₖ₋₁+…+aₖ₋₁S₁+kaₖ=0 for k≤n
Method
Apply Newton’s identities in rational arithmetic, switching to the homogeneous recurrence after the polynomial degree.
Conditions
The calculation includes complex roots and multiplicity algebraically; it does not approximate or list the roots themselves.
Historical position
This is a modern symmetric-polynomial companion to the site’s exact equation tools.
Inputs
Equation coefficients: default 1, -6, 11, -6 — Highest degree first; degree at most 12. Each value may contain up to 24 characters and have absolute value at most 1,000,000; decimals and fractions are accepted.
Highest power k: default 8 — An integer from 1 to 30.
Calculate the real kth root and certify its decimal bounds with integer inequalities.
Result
Real kth root (Certified interval)
Formula
Lᵏ ≤ N·10^(kp) < (L+1)ᵏ
Method
Find the greatest integer L with L^k not exceeding the scaled radicand, then convert L and L+1 into decimal bounds.
Conditions
Even roots require non-negative inputs; odd roots may be negative. An exact result is shown when available; otherwise, two adjacent decimals enclose the root.
Historical position
This extends the digit discipline of traditional square- and cube-root extraction with modern large-integer computation.
Inputs
Number N: default 2 — An integer, decimal, or fraction of up to 80 characters.
Root index k: default 7 — An integer from 2 to 20.
Decimal places: default 20 — An integer from 0 to 40.
Perform exact polynomial division, build a rational linear system for the coefficients, and verify recombination.
Conditions
Only linear factors with rational roots are supported.
Historical position
This modern symbolic tool supports rational approximation and series calculations elsewhere on the site.
Inputs
Numerator coefficients: default 1,0,1 — Highest degree first; degree at most 12. Each value may contain up to 24 characters and have absolute value at most 1,000,000.
Denominator factors, one root,multiplicity pair per line: default 1,2
-1,1 — The denominator is ∏(x−r)^m. Enter one root and multiplicity per row; total degree at most 10. Each value may contain up to 24 characters and have absolute value at most 1,000,000; total input is limited to 600 characters.
Intersect a line of rational slope through a known rational point with a quadratic curve.
Result
Second intersection (x, y) (Exact rational arithmetic)
Formula
Substitute y−y₀=t(x−x₀) into the quadratic curve
Method
Substitute y−y0=t(x−x0), divide out the known root, and solve the remaining linear factor exactly.
Conditions
The supplied base point must lie on the conic. Tangent and degenerate line cases are reported separately.
Historical position
This is a modern algebraic construction included to extend exact equation and geometry work.
Inputs
Coefficients A, B, C, D, E, F: default 1,0,1,0,0,-1 — Each value may contain up to 24 characters and have absolute value at most 1,000,000. The curve is Ax²+Bxy+Cy²+Dx+Ey+F=0.
Calculate the signed area, absolute area, orientation, and centroid of a simple polygon.
Result
Area of the polygon (Exact rational arithmetic)
Formula
2A = |Σ(xᵢyᵢ₊₁−xᵢ₊₁yᵢ)|
Method
Apply the shoelace sums exactly and divide the corresponding moments by six times the signed area.
Conditions
Vertices must be supplied in boundary order. Self-intersections and repeated-edge ambiguities are not interpreted as a simple land parcel.
Historical position
Coordinate area provides a modern computational counterpart to practical survey-area problems.
Inputs
Vertices, one x,y pair per line: default 0,0
4,0
4,1
1,1
1,4
0,4 — Enter 3–30 vertices. Each coordinate may contain up to 24 characters and have absolute value at most 1,000,000; decimals and fractions are accepted. Total input is limited to 1,400 characters.
Build the polynomial recurrence for twice the cosine of a central angle and connect it to a regular polygon.
Result
Side length of the regular polygon (Coefficients linked to geometry)
Formula
C₀=2, C₁=t, Cₖ=tCₖ₋₁−Cₖ₋₂; Cₙ(t)=2
Method
Generate C0=2, C1=t, and Ck=tCk−1−Ck−2, then impose Cn(t)=2.
Conditions
The displayed equation can factor; it is not necessarily the minimal polynomial of t=2cos(2π/n).
Historical position
Inspired by Seki’s work on regular polygons, this calculator uses a modern angle recurrence. It does not reconstruct the lost historical method for predicting equation degrees.
Inputs
Number of sides n: default 7 — An integer from 3 to 60.
Circumradius R: default 2 — From 0.001 to 1,000,000; decimals and fractions are accepted.
For a unit circle, update the half-chord with a stable square-root recurrence, then compare inner and outer semiperimeters. A three-term extrapolation is shown separately.
Conditions
The geometric inequalities are exact, but the displayed decimal values use floating-point arithmetic. The accelerated value is not itself a certified bound.
Historical position
Enri is the wasan study of circles and curved figures. This tool presents polygonal approximation in modern notation and distinguishes it from later convergence acceleration.
Inputs
Number of side doublings: default 7 — Computes through a polygon with 6 × 2ⁿ sides.
Integrate the ellipse speed over a chosen parameter-angle interval.
Result
Length of the selected arc of the ellipse (Subdivision with lower and upper estimates)
Formula
L = ∫ √(a²sin²t + b²cos²t) dt
Method
Use composite Simpson’s rule for the estimate, and bound each subinterval using its minimum and maximum speed.
Conditions
The bounds follow mathematical inequalities but are evaluated in floating-point arithmetic, without a guarantee covering rounding error. Very slender ellipses may need more subdivisions.
Historical position
This is a modern extension from complete circumference to partial curved length.
Inputs
Horizontal semiaxis a: default 5 — From 0.001 to 1,000,000; decimals and fractions are accepted.
Vertical semiaxis b: default 3 — From 0.001 to 1,000,000; decimals and fractions are accepted.
Starting angle (degrees): default 0 — From 0° to 360°.
Ending angle (degrees): default 60 — At least the starting angle and no more than 360°.
Number of subdivisions: default 512 — An integer from 16 to 4,096.
Find the parallel chord positions that split a disk into specified fractional areas.
Result
Cut positions (Numerical area-ratio checks)
Formula
C(u)=u√(1−u²)+arcsin(u)+π/2
Method
Normalize to the unit disk, invert the cumulative area function by safeguarded bisection, then rescale.
Conditions
All weights must be positive and not vanishingly small relative to the total. Positions are numerical and checked by area residuals.
Historical position
This is a modern computational extension of circle-division and mensuration themes.
Inputs
Radius R: default 1 — From 0.001 to 1,000,000; each value is limited to 24 characters. Decimals and fractions are accepted.
Area weights from left to right: default 1,1,1 — Enter 2–20 positive values, left to right. Each may contain up to 24 characters and have absolute value at most 1,000,000; each share must be at least one hundred-millionth of the total.
Round the common logarithms of a and b to the chosen number of table digits, add them, then take the antilogarithm. The tool simulates the logic of calculation with logarithm tables.
Result
Product reconstructed from rounded logarithms (Approximation using a simulated logarithm table)
Formula
log(ab)=log(a)+log(b)
Method
Use Math.log10 only to obtain a modern floating-point reference value. Round that value to the selected table precision, and use only the rounded logarithms to reconstruct the product.
Conditions
a and b must be positive decimal numbers from 10^-100 through 10^100; scientific notation is not accepted. This simulates the principle of table-based calculation and is not a transcription of a historical logarithm table.
Historical position
Late-Edo wasan practitioners received logarithm tables through Western mathematics and used them in fields such as calendrical calculation and surveying. This page does not present logarithms as an independent Japanese invention.
Inputs
a: default 1034 — A positive decimal number.
b: default 2213 — A positive decimal number.
Decimal places in the log table: default 9 — 4–12 decimal places.
Choose an angle and recompute the arc length, half-chord and sagitta of a circle of diameter 1 with modern trigonometric functions. The table also shows nearby integer-degree entries on either side.
Result
Half-chord in a circle of diameter 1 (Recomputed with modern trigonometric functions)
Formula
half-chord=(1/2)sinθ / sagitta=(1/2)(1−cosθ)
Method
Recompute the values with modern sin, cos and π. This does not reconstruct Takebe’s historical calculation procedure.
Conditions
The angle must be an integer from 0° through 90°. Values are floating-point approximations. The selected display precision must not be confused with the certified accuracy of a historical table.
Historical position
The National Diet Library describes Takebe Katahiro’s Sanreki Zakkō as Japan’s first trigonometric table and notes that it gives half-chords for a diameter-1 circle at one-degree intervals to 11 decimal places. Takebe’s table is distinguished here from later imported and translated Western trigonometric tables.
Inputs
Angle (degrees): default 30 — An integer from 0° through 90°.
Two circles rest on the same line and touch each other. This tool finds the smaller circle that fits exactly between them.
Result
Radius r of the circle in the gap (Approximate decimal value)
Formula
1 / √r = 1 / √a + 1 / √b
Method
Split the distance between the two original points of contact and solve 2√ab = 2√ar + 2√br.
Conditions
The two given circles must lie on the same side of one line and be externally tangent. All radii use the same unit.
Historical position
Sangaku were mathematical votive tablets displayed at temples and shrines. This is a modern teaching reconstruction of a common tangent-circle problem, not a transcription of one tablet.
Inputs
Left circle radius a: default 9 — 0.000001 to 1,000,000.
Right circle radius b: default 4 — Use the same unit as a.
Given three mutually tangent circles, calculate the two curvatures allowed by the Descartes circle relation.
Result
Selected tangent circle or boundary (Both configurations checked)
Formula
k₄ = k₁+k₂+k₃ ± 2√(k₁k₂+k₂k₃+k₃k₁)
Method
Convert radii to signed curvatures, solve the two branches, then reconstruct and verify tangency.
Conditions
Inputs must describe the supported tangency configuration and meet the stated scale limits. Signed curvature distinguishes enclosing circles.
Historical position
The theorem is a modern comparative tool for tangent-circle problems; its use here does not assign the European theorem to historical wasan authors.
Inputs
Radius of circle A: default 1 — From 0.001 to 1,000,000; integers, decimals, and fractions are accepted. The largest radius may be at most 10,000 times the smallest.
Calculate the classical Malfatti circles tangent to pairs of triangle sides and to one another.
Result
Radii of the circles at vertices A, B and C (Approximate decimal value)
Formula
Each circle touches two sides; center distances equal sums of radii
Method
Construct the triangle, solve the coupled radius relations numerically, and verify side and circle contacts.
Conditions
The sides must form a nondegenerate triangle. Results are numerical and should be judged by the reported residuals.
Historical position
The configuration is used as a modern comparison for Japanese three-side, three-circle problems; historical naming and modern theorem are kept distinct.
Inputs
Side BC, opposite A: default 507 — From 0.001 to 1,000,000; decimals and fractions are accepted.
Side CA, opposite B: default 375 — From 0.001 to 1,000,000; decimals and fractions are accepted.
Side AB, opposite C: default 252 — From 0.001 to 1,000,000; decimals and fractions are accepted.
Given three positioned circles, solve the sign choices for internal and external tangency.
Result
Tangent circles satisfying the conditions (Internal and external tangencies checked)
Formula
|center−centerᵢ| = |ρ+σᵢrᵢ|; σᵢ=±1
Method
Solve each tangency-sign branch, substitute into the remaining quadratic, and verify every distance condition.
Conditions
Degenerate and coincident configurations may have infinitely many solutions or require cases outside this solver.
Historical position
The Apollonius formulation is a modern general framework that helps compare many special tangent-circle problems.
Inputs
Circle centers and radii, one x,y,r row per line: default 0,0,1
4,0,1
0,3,1 — Enter exactly three rows. Coordinates must have absolute value at most 1,000,000; radii must be from 0.001 to 1,000,000. Each value is limited to 24 characters and total input to 1,400 characters.
Calculate the closure angle for circles tangent to two nonconcentric boundary circles.
Result
Closure of the circle chain (Tangency, closure and overlap checks)
Formula
C=(R²+r²−d²)/(2Rr); δ=2 asin√((C−1)/(C+1)); nδ=2π
Method
Compute the invariant C, derive the step angle, and compare n steps with one full turn.
Conditions
The inner circle must lie strictly inside the outer circle. Closure is reported with exact conditions where possible and a numerical residual otherwise.
Historical position
Steiner chains provide a modern framework for circle-chain questions related to, but historically distinct from, wasan contact problems.
Inputs
Outer radius R: default 3 — From 0.001 to 1,000,000; integers, decimals, and fractions are accepted.
Inner radius r: default 2/3
Center offset d: default 5/3 — Non-negative, with d+r<R.
Number of circles n: default 6 — An integer from 3 to 24; the test is for a ring closing in one revolution.
Starting angle (degrees): default 0 — From 0° to 360°, measured on the concentric-circle image.
Use the three-dimensional Soddy–Gossett relation to calculate two possible tangent spheres.
Result
Selected tangent sphere or boundary (Centers and tangencies checked)
Formula
(Σ kᵢ)² = 3 Σ kᵢ² for five spheres
Method
Solve the curvature equation, construct centers from distance constraints, and report the largest contact residual.
Conditions
The four spheres must form a compatible tetrahedral contact configuration within the stated scale ratio.
Historical position
This modern theorem is used to compare spatial contact geometry with wasan sphere problems; it is not presented as a historical Japanese formula.
Inputs
Radius of sphere A: default 1 — From 0.001 to 1,000,000; integers, decimals, and fractions are accepted. The largest radius may be at most 10,000 times the smallest.
Calculate the volume shared by two perpendicular circular cylinders, including unequal radii.
Result
Intersection volume V (Certified bounds from cross-sections)
Formula
V = 8∫₀ᵇ √(b²−z²)√(a²−z²) dz, a≥b
Method
Integrate the rectangular cross-sectional area, which is four times the product of the two half-widths. Equal radii use a closed form; unequal radii use bounded series evaluation.
Conditions
Radii must be positive. For unequal radii, precision is represented by the reported interval rather than decimal length alone.
Historical position
The equal-radius Steinmetz solid is classical; the unequal-radius interval calculation is a modern extension for this laboratory.
Inputs
Radius of cylinder A: default 2 — From 0.001 to 1,000,000; integers, decimals, and fractions are accepted.
Radius of cylinder B: default 1 — From 0.001 to 1,000,000; integers, decimals, and fractions are accepted.
Number of terms: default 100 — An integer from 1 to 1,000.
Compute the Taylor coefficients of a formal quotient to a chosen order.
Result
Quotient series through the specified degree (Exact coefficient arithmetic)
Formula
cₖ = (aₖ − Σⱼ₌₁ᵏ bⱼcₖ₋ⱼ) / b₀
Method
Use the coefficient recurrence obtained by equating coefficients in (denominator) × (quotient) = (numerator).
Conditions
Coefficients are entered from constant term upward, the reverse of the polynomial tools. The result is formal and does not by itself prove analytic convergence.
Historical position
This modern formal-series tool supports the arc, reversion, and rational-approximation investigations on the site.
Inputs
Numerator coefficients, constant term first: default 1 — Constant term first; degree at most 12. Each value may contain up to 24 characters and have absolute value at most 1,000,000.
Denominator coefficients, constant term first: default 1, -1, -1 — The constant term must be nonzero. Note that this coefficient order is the reverse of the polynomial tools.
Truncation degree N: default 12 — An integer from 0 to 30.
Given f with zero constant term and nonzero linear term, find g so that f(g(x))=x to the requested order.
Result
Inverse series g(x) (Exact coefficient arithmetic)
Formula
f(g(x))=x and g(f(x))=x through the requested order
Method
Compose truncated series in exact rational arithmetic and solve the coefficients in increasing order.
Conditions
The result is a formal local inverse. A nonzero linear coefficient is essential, and analytic convergence is not asserted.
Historical position
Series reversion is a modern extension of coefficient-centered computational methods.
Inputs
Coefficients of f, constant term first: default 0,1,-1 — Constant term zero and linear coefficient nonzero; degree at most 12. Each value may contain up to 24 characters and have absolute value at most 1,000,000.
Truncation degree N: default 8 — An integer from 1 to 20.
Compute coefficients of F(x)^α when F(0)=1 and α is rational.
Result
Series raised to the specified power (Coefficients checked exactly)
Formula
Fg′ = αF′g; g(0)=1
Method
Apply that identity recursively in exact rational arithmetic and verify by coefficient comparison when applicable.
Conditions
The input constant term must be one. The output is a formal truncated series and makes no independent convergence claim.
Historical position
This modern series tool exposes the coefficient mechanism behind many root and reciprocal expansions.
Inputs
Series coefficients, constant term first: default 1,1 — Constant term first; require constant term 1 and degree at most 20. Each value may contain up to 24 characters and have absolute value at most 1,000,000.
Exponent α: default 1/2 — From −20 to 20; decimals and fractions are accepted.
Highest degree N: default 10 — An integer from 1 to 20.
Find a formal series solution of F(x,y)=0 from a chosen value y(0).
Result
Series for the specified initial value (Exact substitution into original equation)
Formula
F(x,y(x))=0; Fᵧ(0,y₀)≠0
Method
Substitute a truncated unknown series, collect terms by degree, and solve the next coefficient exactly.
Conditions
The initial value must satisfy F(0,y0)=0 and Fy(0,y0) must be nonzero. The result is local and formal.
Historical position
This modern implicit-function calculation extends elimination into coefficient-by-coefficient solution.
Inputs
Terms of F(x,y), one x-power,y-power,coefficient row per line: default 0,1,1
1,0,-1
0,2,-1 — Enter at most 16 rows defining F=0. Each row gives the x exponent, y exponent, and coefficient; exponents run from 0 to 8. Each value may contain up to 24 characters and have absolute value at most 1,000,000; total input is limited to 1,400 characters.
Value y(0): default 0 — Up to 24 characters, with absolute value at most 1,000,000.
Highest degree: default 10 — An integer from 1 to 16.
Construct numerator and denominator polynomials whose quotient matches a supplied series through the requested order.
Result
Value of the rational approximant (Exact coefficient matching)
Formula
Q(x)f(x)−P(x)=O(x^(m+n+1)); Q(0)=1
Method
Solve the denominator coefficient equations exactly, recover the numerator, and verify every matched coefficient.
Conditions
A requested type can be singular or non-unique. Agreement of series coefficients does not guarantee a uniform approximation away from the origin.
Historical position
This modern rational-approximation tool is presented beside wasan convergence ideas for comparison, not as a historical attribution.
Inputs
Series coefficients, constant term first: default 1,1,1/2,1/6,1/24 — Constant term first; enter at most 17 values. Each may contain up to 24 characters and have absolute value at most 1,000,000.
Numerator degree m: default 2 — An integer from 0 to 8.
Denominator degree n: default 2 — An integer from 0 to 8.
Evaluation point x: default 1 — Up to 24 characters, with absolute value at most 1,000,000.
Find global minimum and maximum values of a polynomial on a closed rational interval.
Result
Bounds for the minimum and maximum (Entire closed interval checked)
Formula
Inspect the endpoints and every real root of f′(x)
Method
Isolate every derivative root in the interval, evaluate the endpoint and stationary-point candidates with interval arithmetic, and combine their bounds.
Conditions
The polynomial degree and coefficient size are bounded. Results are certified intervals, not symbolic radical expressions.
Historical position
This modern optimization tool generalizes the single box problem and makes the completeness check explicit.
Inputs
Coefficients: default 1,0,-3,0 — Highest degree first; degree at most 8. Each value may contain up to 24 characters and have absolute value at most 1,000,000.
Convert a polynomial on each subinterval to Bernstein form and use its coefficients as exact bounds.
Result
Certified lower and upper bounds for the function (Exact rational arithmetic)
Formula
min(bₖ) ≤ Σ bₖBₖ,ₙ(t) ≤ max(bₖ)
Method
Map the interval to [0,1], convert exactly, and optionally bisect to tighten the union of bounds.
Conditions
Deeper subdivision improves bounds but increases the number of intervals. The result encloses the range and need not equal the exact extrema.
Historical position
This modern certified technique complements derivative-based optimization.
Inputs
Coefficients: default 1,-1,0 — Highest degree first; degree at most 12. Each value may contain up to 24 characters and have absolute value at most 1,000,000.
Left endpoint: default 0
Right endpoint: default 1
Subdivision depth: default 4 — An integer from 0 to 7, producing at most 128 subintervals.
Rotate the region between y=P(x) and the x-axis over the chosen interval, and calculate the exact coefficient of pi in the volume.
Result
Volume of the solid of revolution (Exact coefficient of π)
Formula
V = π∫ P(x)² dx
Method
Square P exactly, integrate coefficient by coefficient, and evaluate at rational endpoints.
Conditions
The formula treats |P(x)| as a radius through P(x)². Inputs follow the stated degree and interval bounds.
Historical position
This is a modern integration tool placed alongside area and solid problems in the broader wasan laboratory.
Inputs
Radius polynomial P(x): default 1, 1, 1 — Highest degree first; degree at most 12. Each value may contain up to 24 characters and have absolute value at most 1,000,000; decimals and fractions are accepted.
Left endpoint: default 0 — Up to 24 characters, with absolute value at most 1,000,000.
Right endpoint: default 2 — Must be greater than the left endpoint.