Sangaku Math ((free)) Jun 2026

During Japan’s Edo period (1603–1867), the country was closed off from the rest of the world. While Europe was developing calculus and the language of physics, Japan developed its own unique mathematical tradition called Wasan . The crown jewel of this tradition is —geometric tablets hung in Buddhist temples and Shinto shrines.

From second equation: similarly, [ h - (R+2\sqrt{Rr}) = 2\sqrt{rx} ] [ R + 2\sqrt{Rx} - R - 2\sqrt{Rr} = 2\sqrt{rx} ] [ 2\sqrt{Rx} - 2\sqrt{Rr} = 2\sqrt{rx} ] Divide 2: [ \sqrt{Rx} - \sqrt{Rr} = \sqrt{rx} ] [ \sqrt{Rx} - \sqrt{rx} = \sqrt{Rr} ] [ \sqrt{x}(\sqrt{R} - \sqrt{r}) = \sqrt{Rr} ] [ \sqrt{x} = \frac{\sqrt{Rr}}{\sqrt{R} - \sqrt{r}} ] Square both sides: [ x = \frac{Rr}{(\sqrt{R} - \sqrt{r})^2} ] Multiply numerator and denominator: [ x = \frac{Rr}{R + r - 2\sqrt{Rr}} ] Multiply top and bottom by (R + r + 2\sqrt{Rr}): [ x = \frac{Rr(R + r + 2\sqrt{Rr})}{(R+r)^2 - 4Rr} ] [ (R+r)^2 - 4Rr = R^2 + 2Rr + r^2 - 4Rr = R^2 - 2Rr + r^2 = (R - r)^2 ] So: [ x = \frac{Rr(R + r + 2\sqrt{Rr})}{(R - r)^2} ] But there’s a cleaner known result: Actually, from (\sqrt{x} = \frac{\sqrt{Rr}}{\sqrt{R} - \sqrt{r}}), [ x = \frac{Rr}{(\sqrt{R} - \sqrt{r})^2} ] That is already elegant.

def generate_algebra_problem(self, difficulty_level): # Generate a random algebra problem if difficulty_level == 'easy': # Linear equation: find x given a simple linear equation coefficient = random.randint(1, 10) constant = random.randint(1, 10) problem = f"Solve for x: {coefficient}x = {constant}." solution = f"x = {constant} / {coefficient} = {constant / coefficient}" elif difficulty_level == 'medium': # Quadratic equation: find x given a simple quadratic equation coefficient1 = random.randint(1, 10) coefficient2 = random.randint(1, 10) constant = random.randint(1, 10) problem = f"Solve for x: {coefficient1}x^2 + {coefficient2}x + {constant} = 0." solution = f"x = (-({coefficient2} ± sqrt({coefficient2}^2 - 4*{coefficient1}*{constant}))) / (2*{coefficient1}) = {(-coefficient2 + math.sqrt(coefficient2 ** 2 - 4 * coefficient1 * constant)) / (2 * coefficient1)} or {(-coefficient2 - math.sqrt(coefficient2 ** 2 - 4 * coefficient1 * constant)) / (2 * coefficient1)}" else: # System of linear equations: find x and y given two linear equations coefficient1 = random.randint(1, 10) coefficient2 = random.randint(1, 10) constant1 = random.randint(1, 10) constant2 = random.randint(1, 10) problem = f"Solve for x and y: {coefficient1}x + {coefficient2}y = {constant1}, {coefficient2}x - {coefficient1}y = {constant2}." solution = f"x = ({constant1}*{coefficient1} + {constant2}*{coefficient2}) / ({coefficient1}^2 + {coefficient2}^2) = {(constant1 * coefficient1 + constant2 * coefficient2) / (coefficient1 ** 2 + coefficient2 ** 2)}, y = ({constant1}*{coefficient2} - {constant2}*{coefficient1}) / ({coefficient1}^2 + {coefficient2}^2) = {(constant1 * coefficient2 - constant2 * coefficient1) / (coefficient1 ** 2 + coefficient2 ** 2)}"

The line is horizontal. Circle (R) touches the line at point (A), circle (r) touches the line at (B), and the small circle of radius (x) sits between them, touching the line and the two circles. sangaku math

The most famous examples often look like kaleidoscope patterns, featuring "chains" of circles that decrease in size according to precise ratios. A Geometry for Everyone

return problem, solution

Sangaku math is a historical form of Japanese mathematics that involves solving mathematical problems presented on wooden tablets called sangaku. These problems often involve geometry and algebra. In this feature, we will create a program that can generate and solve sangaku-style math problems. During Japan’s Edo period (1603–1867), the country was

Modern mathematicians continue to study Sangaku, not just for their historical value, but because the problems remain genuinely difficult and clever. They remind us that mathematics is not just a tool for engineering or finance—it is a form of art, a spiritual pursuit, and a universal language that transcends borders and eras.

The program will generate sangaku-style math problems based on a set of predefined parameters, such as:

Because the tablets were displayed in public spaces, mathematics became a communal activity. A traveler might see a tablet at a shrine in Kyoto, spend weeks solving the problem on the road, and hang their solution at a temple in Edo (modern-day Tokyo). The Legacy of Sangaku Today From second equation: similarly, [ h - (R+2\sqrt{Rr})

Calculating the properties of shapes nested within one another.

(算額, literally "calculation tablet") are colorful wooden tablets depicting geometric problems, often solved and dedicated to Shinto shrines or Buddhist temples in Japan. They were created by people from all walks of life—samurai, farmers, merchants, and professional mathematicians (called wasanka )—from the early 17th to the late 19th century (the Edo period).