{
  "id": "pythagorean-triple",
  "title": "Pythagorean Triple",
  "lang": "en",
  "source_lang": "en",
  "summary": "A Pythagorean triple consists of three positive integers satisfying \\(a^2+b^2=c^2\\), representing the side lengths of a right triangle.",
  "category": "mathematics",
  "subcategory": "algebra",
  "type": "concept",
  "aliases": [
    "Pythagorean triplet",
    "Pythagorean triad"
  ],
  "generated_at": "2026-11-04",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/pythagorean-triple/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/pythagorean-triple/",
      "json": "https://aiwiki.page/zh/pythagorean-triple.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "A Pythagorean triple is a triple of positive integers \\((a,b,c)\\) satisfying\n\n\\[a^2+b^2=c^2.\\]\n\nBy the Pythagorean theorem and its converse, these numbers are precisely the possible integer side lengths of a right triangle, with legs \\(a,b\\) and hypotenuse \\(c\\). The simplest example is \\((3,4,5)\\), since \\(9+16=25\\). Pythagorean triples connect geometry with number theory and provide a classical example of a Diophantine equation: an equation whose solutions are required to be integers."
    },
    {
      "heading": "Basic examples and primitive triples",
      "text": "Interchanging the legs does not change the underlying triangle, so \\((a,b,c)\\) and \\((b,a,c)\\) are usually treated as equivalent. The hypotenuse is always the largest entry.\n\nA triple is primitive if\n\n\\[\\gcd(a,b,c)=1,\\]\n\nwhere \\(\\gcd\\) denotes the greatest common divisor. Otherwise, it is nonprimitive.\n\nExamples include:\n\nTriple | Type\n\\((3,4,5)\\) | Primitive\n\\((5,12,13)\\) | Primitive\n\\((8,15,17)\\) | Primitive\n\\((7,24,25)\\) | Primitive\n\\((20,21,29)\\) | Primitive\n\\((6,8,10)\\) | Nonprimitive: twice \\((3,4,5)\\)\n\\((9,12,15)\\) | Nonprimitive: three times \\((3,4,5)\\)\n\nMultiplying every entry of a triple by a positive integer produces another triple:\n\n\\[(ka)^2+(kb)^2=k^2c^2.\\]\n\nConversely, dividing all three entries by their greatest common divisor produces a primitive triple. Thus every Pythagorean triple is a positive integer multiple of a unique primitive triple, apart from the order of its legs.\n\nIn a primitive triple, the entries are also pairwise coprime. If a prime divided any two entries, the defining equation would force it to divide the third."
    },
    {
      "heading": "Euclid’s parametrization",
      "text": "All primitive Pythagorean triples are generated, up to interchanging the legs, by\n\n\\[a=m^2-n^2,\\qquad b=2mn,\\qquad c=m^2+n^2,\\]\n\nwhere \\(m,n\\) are positive integers satisfying\n\n\\[m>n,\\qquad \\gcd(m,n)=1,\\]\n\nand \\(m,n\\) have opposite parity: one is even and the other odd.\n\nThis construction is commonly called Euclid’s formula. Its underlying identity is\n\n\\[(m^2-n^2)^2+(2mn)^2=(m^2+n^2)^2.\\]\n\nFor example:\n\n\\(m\\) | \\(n\\) | Triple\n2 | 1 | \\((3,4,5)\\)\n3 | 2 | \\((5,12,13)\\)\n4 | 1 | \\((15,8,17)\\)\n4 | 3 | \\((7,24,25)\\)\n5 | 2 | \\((21,20,29)\\)\n\nThe restrictions on \\(m,n\\) ensure primitivity. A common divisor of \\(m,n\\) would give a common factor in all three generated entries. If \\(m,n\\) were both odd, all three entries would be even.\n\nEvery Pythagorean triple therefore has the form\n\n\\[(a,b,c)= \\bigl(k(m^2-n^2),\\,2kmn,\\,k(m^2+n^2)\\bigr),\\]\n\npossibly with the first two entries interchanged, where \\(k\\) is a positive integer and \\(m,n\\) satisfy the primitive conditions.\n\nWhy every primitive triple has this form\n\nThe completeness of the formula follows from parity and factorization.\n\nThe square of an integer is congruent to either \\(0\\) or \\(1\\) modulo \\(4\\). Consequently, the two legs of a primitive triple cannot both be odd, because their squared sum would be congruent to \\(2\\) modulo \\(4\\), which is not a square. They cannot both be even either. Thus exactly one leg is even, and the hypotenuse is odd.\n\nWrite \\(a\\) for the odd leg and \\(b\\) for the even leg. Then\n\n\\[b^2=c^2-a^2=(c-a)(c+a),\\]\n\nso\n\n\\[\\left(\\frac b2\\right)^2 = \\frac{c+a}{2}\\,\\frac{c-a}{2}.\\]\n\nThe two factors on the right are positive, coprime integers: any common divisor would divide both their sum \\(c\\) and their difference \\(a\\). By the fundamental theorem of arithmetic, coprime positive integers whose product is a square must each be squares. Hence\n\n\\[\\frac{c+a}{2}=m^2,\\qquad \\frac{c-a}{2}=n^2.\\]\n\nAdding and subtracting gives \\(c=m^2+n^2\\) and \\(a=m^2-n^2\\); the equation for \\(b\\) then gives \\(b=2mn\\).\n\nWith the odd leg designated as \\(a\\), these equations also show that \\(m,n\\) are uniquely determined by a primitive triple."
    },
    {
      "heading": "Divisibility properties",
      "text": "Pythagorean triples have several useful restrictions, many of which follow from modular arithmetic.\n\nFor a primitive triple:\n\n- Exactly one leg is even, and that leg is divisible by \\(4\\). In Euclid’s formula, one of \\(m,n\\) is even, so \\(2mn\\) is a multiple of \\(4\\).\n- The hypotenuse is odd and satisfies \\(c\\equiv1\\pmod4\\).\n- Exactly one leg is divisible by \\(3\\). If neither leg were divisible by \\(3\\), their squares would sum to \\(2\\) modulo \\(3\\), which is impossible for a square.\n- Exactly one of the three entries is divisible by \\(5\\). If neither leg were divisible by \\(5\\), their squared residues would have to be \\(1\\) and \\(4\\), making the hypotenuse divisible by \\(5\\).\n- The area \\(ab/2\\) is an integer divisible by \\(6\\), because the product of the legs is divisible by \\(12\\).\n\nThe restrictions to primitive triples matter. For example, the nonprimitive triple \\((15,20,25)\\) has all three entries divisible by \\(5\\).\n\nThese divisibility conditions are necessary but not sufficient: numbers may satisfy them without satisfying the Pythagorean equation."
    },
    {
      "heading": "Connection with rational points on a circle",
      "text": "Dividing a Pythagorean equation by \\(c^2\\) gives\n\n\\[\\left(\\frac ac\\right)^2+\\left(\\frac bc\\right)^2=1.\\]\n\nThus each triple determines a point with rational coordinates on the unit circle. Conversely, clearing denominators in a rational point with positive coordinates produces a Pythagorean triple.\n\nA geometric construction explains the parametrization. Consider the line through \\((-1,0)\\) with rational slope \\(t\\):\n\n\\[y=t(x+1).\\]\n\nIts second intersection with \\(x^2+y^2=1\\) is\n\n\\[x=\\frac{1-t^2}{1+t^2},\\qquad y=\\frac{2t}{1+t^2}.\\]\n\nSetting \\(t=n/m\\), with \\(0<n<m\\), gives\n\n\\[x=\\frac{m^2-n^2}{m^2+n^2},\\qquad y=\\frac{2mn}{m^2+n^2}.\\]\n\nThis is Euclid’s formula after clearing denominators. It illustrates a general method in analytic geometry: using lines through a known rational point to parametrize rational points on a conic section."
    },
    {
      "heading": "Infinite families and generation",
      "text": "There are infinitely many primitive Pythagorean triples. Setting \\(n=1\\) and taking any even integer \\(m\\ge2\\) gives\n\n\\[(m^2-1,\\;2m,\\;m^2+1),\\]\n\nwith no common divisor.\n\nAnother useful family begins with any odd integer \\(r\\ge3\\):\n\n\\[\\left( r,\\; \\frac{r^2-1}{2},\\; \\frac{r^2+1}{2} \\right).\\]\n\nThe last two entries differ by \\(1\\), and\n\n\\[\\left(\\frac{r^2+1}{2}\\right)^2 - \\left(\\frac{r^2-1}{2}\\right)^2=r^2.\\]\n\nThis yields \\((3,4,5)\\), \\((5,12,13)\\), \\((7,24,25)\\), and infinitely many others.\n\nFor computational enumeration, Euclid’s formula is more efficient than testing every possible triple of integers. To list triples with \\(c\\le H\\), it is enough to consider\n\n\\[m^2+n^2\\le H\\]\n\nunder the coprimality and parity conditions, then include multiples whose hypotenuses remain within the bound. The Euclidean algorithm supplies an efficient coprimality test."
    },
    {
      "heading": "Historical background",
      "text": "Integer right-triangle relations were known long before the surviving Greek mathematical texts. Old Babylonian mathematical documents contain numerical examples and systematic work involving such relations. The tablet commonly called Plimpton 322 records numbers associated with Pythagorean triples, although its precise purpose and methods of construction remain subjects of scholarly interpretation.\n\nGreek mathematics developed geometric and arithmetic treatments of these relationships. Euclid’s Elements, Book X, Proposition 29, includes a construction of square numbers whose sum is a square, closely related to the parametrization now bearing his name.\n\nThe conventional name “Pythagorean triple” reflects the association with the Pythagorean theorem; it does not imply that Pythagoras was the first person to know or generate such triples."
    },
    {
      "heading": "Applications and related problems",
      "text": "Pythagorean triples provide exact integer dimensions for right triangles and rectangles with integer diagonals. The familiar \\(3\\)-\\(4\\)-\\(5\\) triangle can be used to lay out a right angle, though any physical construction remains limited by measurement accuracy.\n\nIn mathematics, triples serve as examples in factorization, rational parametrization, congruences, and Diophantine analysis. They also distinguish integer geometry from unrestricted Euclidean geometry: most right triangles do not have three integer side lengths, even after rescaling.\n\nThe equation\n\n\\[a^2+b^2=c^2\\]\n\nhas infinitely many positive integer solutions, whereas Fermat’s Last Theorem states that\n\n\\[a^n+b^n=c^n\\]\n\nhas none when \\(n>2\\) is an integer. Pythagorean triples therefore mark a fundamental contrast between equations involving squares and their higher-power analogues."
    }
  ],
  "links": [
    "integer",
    "pythagorean-theorem",
    "right-triangle",
    "geometry",
    "number-theory",
    "diophantine-equation",
    "greatest-common-divisor",
    "fundamental-theorem-of-arithmetic",
    "modular-arithmetic",
    "rational-number",
    "circle",
    "analytic-geometry",
    "conic-section",
    "euclidean-algorithm",
    "euclid",
    "euclids-elements",
    "euclidean-geometry",
    "fermats-last-theorem"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}