Pythagorean Triple Calculator

Generate all primitive Pythagorean triples (a,b,c) with a²+b²=c² up to a given hypotenuse. Uses Euclid's formula (m²-n², 2mn, m²+n²), verifies triples, and explains primitive vs non-primitive, Gaussian integers, and Fermat's Last Theorem.

Primitive triples (a,b,c) with c <= max
Count of primitive triples
Count including non-primitive
Extended More scenarios, charts & detailed breakdown
Primitive triples
Count
Smallest triple
Professional Full parameters & maximum detail

Triple & Family

Triple from m,n
Non-primitive family (k*triple)

Theory & Connections

Parameterization theorem
Gaussian integer connection
Fermat's Last Theorem context

How to Use This Calculator

  1. Enter max hypotenuse c to list all primitive triples with c up to that value.
  2. Use Euclid's Formula tab with m,n to generate a specific triple.
  3. Use Verify tab to check if any three numbers form a Pythagorean triple.
  4. Professional shows the full parameterization theorem and Gaussian integer connection.

Formula

Euclid's formula: a = m^2-n^2, b = 2mn, c = m^2+n^2 (m > n > 0, gcd=1, m-n odd)

Verify: a^2 + b^2 = c^2

Example

m=2, n=1: a=3, b=4, c=5. 9+16=25. Primitive since gcd(3,4,5)=1. Non-primitive family: (6,8,10), (9,12,15), ...

Frequently Asked Questions

  • A set of three positive integers (a, b, c) satisfying a^2 + b^2 = c^2. The simplest example is (3, 4, 5) since 9+16=25.
  • A primitive triple has gcd(a, b, c) = 1, meaning no common factor. (3,4,5) is primitive; (6,8,10) is not (it is 2*(3,4,5)).
  • Choose integers m > n > 0 with gcd(m,n)=1 and m-n odd. Then a=m^2-n^2, b=2mn, c=m^2+n^2 gives a primitive triple. m=2,n=1 gives (3,4,5).
  • Yes — infinitely many primitive triples exist. For any primitive triple, multiplying by any positive integer k gives a non-primitive triple. So there are infinitely many total.
  • Pythagorean triples are solutions to x^2+y^2=z^2. Fermat's Last Theorem (proved by Andrew Wiles in 1995) states there are NO positive integer solutions to x^n+y^n=z^n for n>=3.

Related Calculators

Sources & References (5)
  1. An Introduction to the Theory of Numbers — Hardy & Wright — Oxford University Press
  2. Euclid Elements Book X — Pythagorean Triples — Clark University (Joyce's Euclid)
  3. OpenStax Algebra and Trigonometry — Pythagorean Triples — OpenStax
  4. Khan Academy — Pythagorean Triples — Khan Academy
  5. MathWorld — Pythagorean Triple — Wolfram Research