StatGardenREF. DESK
Calculators/Maths/Pythagorean triple generator
Maths

Pythagorean triple generator calculator

Builds a right-triangle integer triple from two generator numbers (Euclid’s formula).

What this calculator does

Pythagorean triple generator works out builds a right-triangle integer triple from two generator numbers (Euclid’s formula). Enter your own figures above and the answer updates as you type: nothing is fixed in the code, so the result reflects exactly the numbers you supply.

The formula this calculator evaluates is printed under the tool and explained below, so you can check the working by hand or reuse it in a spreadsheet.

The formula

Formulaa = m²−n², b = 2mn, c = m²+n² for m > n > 0; primitive when gcd(m,n)=1 and m, n have opposite parity

The inputs explained

FieldWhat to enter
m (larger generator)A number. Starts at 2.
n (smaller generator)A number. Starts at 1.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How the answer changes with m (larger generator)

Every other input is held at the calculator’s starting values while m (larger generator) varies. Select any row to load that scenario into the calculator.

How the answer changes with m (larger generator)
m (larger generator)Need m > n ≥ 1
1N/AN/AN/A
1.53, 4, 525 vs 25Yes
23, 4, 525 vs 25Yes
38, 6, 10100 vs 100No: gcd(m,n)=1, m and n share parity
415, 8, 17289 vs 289Yes
635, 12, 371,369 vs 1,369Yes