{
  "index": "1965-B-3",
  "type": "NT",
  "tag": [
    "NT",
    "ALG"
  ],
  "difficulty": "",
  "question": "B-3. Prove that there are exactly three right-angled triangles whose sides are integers while the area is numerically equal to twice the perimeter.",
  "solution": "B-3. All Pythagorean triples can be obtained from \\( x=\\lambda\\left(p^{2}-q^{2}\\right), y=2 \\lambda p q \\), \\( z=\\lambda\\left(p^{2}+q^{2}\\right) \\) where \\( 0<q<p,(p, q)=1 \\) and \\( p \\not \\equiv q \\bmod 2, \\lambda \\) being any natural number.\n\nThe problem requires that \\( \\frac{1}{2} x y=2(x+y+z) \\). This condition can be written \\( \\lambda^{2}\\left(p^{2}-q^{2}\\right)(p q)=2 \\lambda\\left(p^{2}-q^{2}+2 p q+p^{2}+q^{2}\\right) \\) or simply \\( \\lambda(p-q) q=4 \\). Since \\( p-q \\) is odd it follows that \\( p-q=1 \\) and the only possibilities for \\( q \\) are \\( 1,2,4 \\).\n\\[\n\\begin{array}{l}\n\\text { If } q=1, p=2, \\lambda=4, x=12, y=16, z=20 \\text {. } \\\\\n\\text { If } q=2, p=3, \\lambda=2, x=10, y=24, z=26 . \\\\\n\\text { If } q=4, p=5, \\lambda=1, x=9, y=40, z=41 .\n\\end{array}\n\\]",
  "vars": [
    "x",
    "y",
    "z"
  ],
  "params": [
    "p",
    "q",
    "\\\\lambda"
  ],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "x": "sidelengthone",
        "y": "sidelengthtwo",
        "z": "sidelengththree",
        "p": "parameterp",
        "q": "parameterq",
        "\\lambda": "scalefactor"
      },
      "question": "B-3. Prove that there are exactly three right-angled triangles whose sides are integers while the area is numerically equal to twice the perimeter.",
      "solution": "B-3. All Pythagorean triples can be obtained from \\( sidelengthone=scalefactor\\left(parameterp^{2}-parameterq^{2}\\right), sidelengthtwo=2 scalefactor parameterp parameterq \\), \\( sidelengththree=scalefactor\\left(parameterp^{2}+parameterq^{2}\\right) \\) where \\( 0<parameterq<parameterp,(parameterp, parameterq)=1 \\) and \\( parameterp \\not \\equiv parameterq \\bmod 2, scalefactor \\) being any natural number.\n\nThe problem requires that \\( \\frac{1}{2} sidelengthone sidelengthtwo=2(sidelengthone+sidelengthtwo+sidelengththree) \\). This condition can be written \\( scalefactor^{2}\\left(parameterp^{2}-parameterq^{2}\\right)(parameterp parameterq)=2 scalefactor\\left(parameterp^{2}-parameterq^{2}+2 parameterp parameterq+parameterp^{2}+parameterq^{2}\\right) \\) or simply \\( scalefactor(parameterp-parameterq) parameterq=4 \\). Since \\( parameterp-parameterq \\) is odd it follows that \\( parameterp-parameterq=1 \\) and the only possibilities for \\( parameterq \\) are \\( 1,2,4 \\).\n\\[\n\\begin{array}{l}\n\\text { If } parameterq=1, parameterp=2, scalefactor=4, sidelengthone=12, sidelengthtwo=16, sidelengththree=20 \\text {. } \\\\\n\\text { If } parameterq=2, parameterp=3, scalefactor=2, sidelengthone=10, sidelengthtwo=24, sidelengththree=26 . \\\\\n\\text { If } parameterq=4, parameterp=5, scalefactor=1, sidelengthone=9, sidelengthtwo=40, sidelengththree=41 .\n\\end{array}\n\\]"
    },
    "descriptive_long_confusing": {
      "map": {
        "x": "willowtree",
        "y": "parchment",
        "z": "chimneyfire",
        "p": "glassmaker",
        "q": "driftwood",
        "\\lambda": "buttercup"
      },
      "question": "B-3. Prove that there are exactly three right-angled triangles whose sides are integers while the area is numerically equal to twice the perimeter.",
      "solution": "B-3. All Pythagorean triples can be obtained from \\( willowtree=buttercup\\left(glassmaker^{2}-driftwood^{2}\\right), parchment=2 buttercup glassmaker driftwood \\), \\( chimneyfire=buttercup\\left(glassmaker^{2}+driftwood^{2}\\right) \\) where \\( 0<driftwood<glassmaker,(glassmaker, driftwood)=1 \\) and \\( glassmaker \\not \\equiv driftwood \\bmod 2, buttercup \\) being any natural number.\n\nThe problem requires that \\( \\frac{1}{2} willowtree parchment=2(willowtree+parchment+chimneyfire) \\). This condition can be written \\( buttercup^{2}\\left(glassmaker^{2}-driftwood^{2}\\right)(glassmaker driftwood)=2 buttercup\\left(glassmaker^{2}-driftwood^{2}+2 glassmaker driftwood+glassmaker^{2}+driftwood^{2}\\right) \\) or simply \\( buttercup(glassmaker-driftwood) driftwood=4 \\). Since \\( glassmaker-driftwood \\) is odd it follows that \\( glassmaker-driftwood=1 \\) and the only possibilities for \\( driftwood \\) are \\( 1,2,4 \\).\n\\[\n\\begin{array}{l}\n\\text { If } driftwood=1, glassmaker=2, buttercup=4, willowtree=12, parchment=16, chimneyfire=20 \\text {. } \\\\\n\\text { If } driftwood=2, glassmaker=3, buttercup=2, willowtree=10, parchment=24, chimneyfire=26 . \\\\\n\\text { If } driftwood=4, glassmaker=5, buttercup=1, willowtree=9, parchment=40, chimneyfire=41 .\n\\end{array}\n\\]"
    },
    "descriptive_long_misleading": {
      "map": {
        "x": "midpointlen",
        "y": "interiorlen",
        "z": "centerline",
        "p": "negativeval",
        "q": "irrational",
        "\\lambda": "shrinkage"
      },
      "question": "B-3. Prove that there are exactly three right-angled triangles whose sides are integers while the area is numerically equal to twice the perimeter.",
      "solution": "B-3. All Pythagorean triples can be obtained from \\( midpointlen=shrinkage\\left(negativeval^{2}-irrational^{2}\\right), interiorlen=2 shrinkage negativeval irrational \\), \\( centerline=shrinkage\\left(negativeval^{2}+irrational^{2}\\right) \\) where \\( 0<irrational<negativeval,(negativeval, irrational)=1 \\) and \\( negativeval \\not \\equiv irrational \\bmod 2, shrinkage \\) being any natural number.\n\nThe problem requires that \\( \\frac{1}{2} midpointlen interiorlen=2(midpointlen+interiorlen+centerline) \\). This condition can be written \\( shrinkage^{2}\\left(negativeval^{2}-irrational^{2}\\right)(negativeval irrational)=2 shrinkage\\left(negativeval^{2}-irrational^{2}+2 negativeval irrational+negativeval^{2}+irrational^{2}\\right) \\) or simply \\( shrinkage(negativeval-irrational) irrational=4 \\). Since \\( negativeval-irrational \\) is odd it follows that \\( negativeval-irrational=1 \\) and the only possibilities for \\( irrational \\) are \\( 1,2,4 \\).\n\\[\n\\begin{array}{l}\n\\text { If } irrational=1, negativeval=2, shrinkage=4, midpointlen=12, interiorlen=16, centerline=20 \\text {. } \\\\\n\\text { If } irrational=2, negativeval=3, shrinkage=2, midpointlen=10, interiorlen=24, centerline=26 . \\\\\n\\text { If } irrational=4, negativeval=5, shrinkage=1, midpointlen=9, interiorlen=40, centerline=41 .\n\\end{array}\n\\]"
    },
    "garbled_string": {
      "map": {
        "x": "qzxwvtnp",
        "y": "hjgrksla",
        "z": "mnbvcxza",
        "p": "asdflkji",
        "q": "wertyuio",
        "\\lambda": "poiulkjh"
      },
      "question": "B-3. Prove that there are exactly three right-angled triangles whose sides are integers while the area is numerically equal to twice the perimeter.",
      "solution": "B-3. All Pythagorean triples can be obtained from \\( qzxwvtnp=poiulkjh\\left(asdflkji^{2}-wertyuio^{2}\\right), hjgrksla=2 \\, poiulkjh \\, asdflkji \\, wertyuio \\), \\( mnbvcxza=poiulkjh\\left(asdflkji^{2}+wertyuio^{2}\\right) \\) where \\( 0<wertyuio<asdflkji,(asdflkji, wertyuio)=1 \\) and \\( asdflkji \\not \\equiv wertyuio \\bmod 2, poiulkjh \\) being any natural number.\n\nThe problem requires that \\( \\frac{1}{2} qzxwvtnp \\, hjgrksla = 2(qzxwvtnp+hjgrksla+mnbvcxza) \\). This condition can be written \\( poiulkjh^{2}\\left(asdflkji^{2}-wertyuio^{2}\\right)(asdflkji \\, wertyuio)=2 \\, poiulkjh\\left(asdflkji^{2}-wertyuio^{2}+2 \\, asdflkji \\, wertyuio+asdflkji^{2}+wertyuio^{2}\\right) \\) or simply \\( poiulkjh(asdflkji-wertyuio) \\, wertyuio=4 \\). Since \\( asdflkji-wertyuio \\) is odd it follows that \\( asdflkji-wertyuio=1 \\) and the only possibilities for \\( wertyuio \\) are \\( 1,2,4 \\).\n\\[\n\\begin{array}{l}\n\\text { If } wertyuio=1, asdflkji=2, poiulkjh=4, qzxwvtnp=12, hjgrksla=16, mnbvcxza=20 \\text {. } \\\\\n\\text { If } wertyuio=2, asdflkji=3, poiulkjh=2, qzxwvtnp=10, hjgrksla=24, mnbvcxza=26 . \\\\\n\\text { If } wertyuio=4, asdflkji=5, poiulkjh=1, qzxwvtnp=9, hjgrksla=40, mnbvcxza=41 .\n\\end{array}\n\\]"
    },
    "kernel_variant": {
      "question": "Prove that there are exactly fifteen right-angled triangles whose side-lengths are positive integers and whose area is numerically equal to twenty-four times their perimeter.  Moreover, decide which of these fifteen triples are primitive, i.e. whose three side-lengths are relatively prime.",
      "solution": "Notation.  \n• Throughout we write (a , b , c) for the (unordered) triple “leg, leg, hypotenuse’’ and agree to display the two legs in non-decreasing order (shorter first).  \n• (x , y , z) stands for an arbitrary positive integral solution of  \n\n        ½ xy  = 24 (x + y + z),  x² + y² = z².                (★)\n\n\nStep 1.  General parametrisation of all Pythagorean triples  \nEvery integer right-angled triangle can be written\n\n        x = λ( p² – q² ), y = 2λpq, z = λ( p² + q² ),    (1)\n\nwhere λ ∈ ℕ, 0 < q < p, gcd(p , q) = 1, and p ≢ q (mod 2) (opposite parity).\n\nStep 2.  Translating  “area = 24 × perimeter’’  \nArea: A = ½xy = ½·λ²(p² – q²)·2pq = λ² pq (p² – q²).  \nPerimeter: P = x + y + z = λ[(p² – q²) + 2pq + (p² + q²)] = 2λp(p + q).\n\nThe condition A = 24 P therefore reads  \n\n        λ² pq (p² – q²) = 24·2λ p (p + q)  \n⇔      λ q (p² – q²)   = 48 (p + q).                                            (2)\n\nSince p² – q² = (p – q)(p + q) and p + q > 0 we may cancel p + q to obtain the core Diophantine relation  \n\n        λ q (p – q) = 48.                                                      (3)\n\nStep 3.  First arithmetical consequences  \n(i)  p – q is positive and odd (because p and q have opposite parity).  \n(ii) gcd(q , p – q) = 1 (any common divisor would divide both p and q).  \n\nHence p – q must be an odd divisor of 48, whence  \n\n        p – q ∈ {1, 3}.                                                       (4)\n\nStep 4.  Exhaustive analysis of (3)\n\nCASE A.  p – q = 1.  \nEquation (3) becomes λ q = 48.  Because gcd(q , 1) = 1, every divisor q of 48 is allowed:\n\n        q ∈ {1, 2, 3, 4, 6, 8, 12, 16, 24, 48},  λ = 48 / q.     (5)\n\nPut p = q + 1.  Substituting p and λ in (1) gives\n\n        a₀ = λ(2q + 1), b₀ = 2λ q(q + 1), c   = λ(2q² + 2q + 1).     (6)\n\n(The sub-script 0 reminds us that these are “raw’’ legs; in the final table we swap them whenever b₀ < a₀, although this never happens in Case A.)\n\nCASE B.  p – q = 3.  \nNow (3) reads λ q = 48 / 3 = 16.  \nBecause gcd(q , 3) = 1, q must be a divisor of 16:\n\n        q ∈ {1, 2, 4, 8, 16},  λ = 16 / q.                     (7)\n\nPut p = q + 3; inserting in (1) yields\n\n        a₀ = λ·3(2q + 3) = λ(6q + 9),  \n        b₀ = 2λ q(q + 3),  \n        c   = λ(2q² + 6q + 9).                                    (8)\n\nHere b₀ can occasionally be smaller than a₀, so a final ordering step will be required.\n\nNo other values of p – q are possible by (4), so (6) together with (8) already parametrize all triangles whose area equals 24 times their perimeter.\n\nStep 5.  Explicit enumeration  \nFor each admissible q we compute (a₀ , b₀ , c) and finally write (a , b , c) with a ≤ b.\n\nA-series  (p – q = 1, λ q = 48)\n\n q   λ   (a , b , c)            Δ = gcd(a , b , c)\n 1   48  (144,  192,   240)      48\n 2   24  (120,  288,   312)      24\n 3   16  (112,  384,   400)      16\n 4   12  (108,  480,   492)      12\n 6    8  (104,  672,   680)       8\n 8    6  (102,  864,   870)       6\n12    4  (100, 1248,  1252)       4\n16    3   ( 99, 1632,  1635)      3\n24    2   ( 98, 2400,  2402)      2\n48    1   ( 97, 4704,  4705)      1  ← primitive\n\nB-series  (p – q = 3, λ q = 16)\n\n q   λ   (a , b , c)            Δ = gcd(a , b , c)\n 1   16  (128,  240,   272)      16\n 2    8  (160,  168,   232)       8\n 4    4  (132,  224,   260)       4\n 8    2  (114,  352,   370)       2\n16    1  (105,  608,   617)       1  ← primitive\n\nWe therefore obtain exactly 10 + 5 = 15 distinct integral right-angled triangles.\n\nStep 6.  Primitivity  \nBecause gcd(p , q) = 1, equation (1) shows that the common divisor of x , y , z is precisely λ.  Consequently the triple is primitive iff λ = 1.  Inspecting the tables we find precisely two such instances:\n\n• (97, 4704, 4705) (from the A-series, q = 48),  \n• (105, 608, 617) (from the B-series, q = 16).\n\nConclusion.  \nEquation (★) possesses exactly fifteen integral solutions, listed above, and exactly two of the corresponding triangles are primitive, namely (97, 4704, 4705) and (105, 608, 617).",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T19:09:31.558431",
        "was_fixed": false,
        "difficulty_analysis": "Compared with the original problem (“area = 2 × perimeter”) and the current kernel variant (“area = 8 × perimeter”), the enhanced variant raises the\ndifficulty in several independent ways.\n\n1.  The multiplicative constant 24 gives the core Diophantine constraint\n    λq(p–q)=48, whose factor structure (48 = 2⁴·3) is far richer than the\n    previous constants 4 and 16.  It forces a systematic case\n    decomposition that is impossible to guess by inspection.\n\n2.  Because 48 has ten divisors and the odd-divisor condition admits two\n    distinct gaps (p–q=1 and p–q=3), the solver must handle **two separate\n    sub-families**, each still containing several possibilities.  This\n    produces fifteen distinct triples instead of three or five, so mere\n    “pattern spotting’’ or trial–and–error is hopeless; a rigorous factor\n    analysis is unavoidable.\n\n3.  Verifying primitivity is no longer immediate but requires an additional\n    argument involving the exact role of the scaling parameter λ.\n\n4.  The solution seamlessly blends several classical techniques\n    (parametrisation of Pythagorean triples, parity arguments, coprimality\n    considerations, divisor counting) which interact non-trivially.  Each\n    step depends on previous observations, and skipping one of them breaks\n    the entire chain.\n\n5.  Finally, the task demands a complete *classification* (all 15 triples\n    explicitly listed) and a *second* classification (primitive vs.\n    non-primitive), greatly increasing both computational and conceptual\n    workload."
      }
    },
    "original_kernel_variant": {
      "question": "Prove that there are exactly fifteen right-angled triangles whose side-lengths are positive integers and whose area is numerically equal to twenty-four times their perimeter.  Moreover, decide which of these fifteen triples are primitive, i.e. whose three side-lengths are relatively prime.",
      "solution": "Notation.  \n• Throughout we write (a , b , c) for the (unordered) triple “leg, leg, hypotenuse’’ and agree to display the two legs in non-decreasing order (shorter first).  \n• (x , y , z) stands for an arbitrary positive integral solution of  \n\n        ½ xy  = 24 (x + y + z),  x² + y² = z².                (★)\n\n\nStep 1.  General parametrisation of all Pythagorean triples  \nEvery integer right-angled triangle can be written\n\n        x = λ( p² – q² ), y = 2λpq, z = λ( p² + q² ),    (1)\n\nwhere λ ∈ ℕ, 0 < q < p, gcd(p , q) = 1, and p ≢ q (mod 2) (opposite parity).\n\nStep 2.  Translating  “area = 24 × perimeter’’  \nArea: A = ½xy = ½·λ²(p² – q²)·2pq = λ² pq (p² – q²).  \nPerimeter: P = x + y + z = λ[(p² – q²) + 2pq + (p² + q²)] = 2λp(p + q).\n\nThe condition A = 24 P therefore reads  \n\n        λ² pq (p² – q²) = 24·2λ p (p + q)  \n⇔      λ q (p² – q²)   = 48 (p + q).                                            (2)\n\nSince p² – q² = (p – q)(p + q) and p + q > 0 we may cancel p + q to obtain the core Diophantine relation  \n\n        λ q (p – q) = 48.                                                      (3)\n\nStep 3.  First arithmetical consequences  \n(i)  p – q is positive and odd (because p and q have opposite parity).  \n(ii) gcd(q , p – q) = 1 (any common divisor would divide both p and q).  \n\nHence p – q must be an odd divisor of 48, whence  \n\n        p – q ∈ {1, 3}.                                                       (4)\n\nStep 4.  Exhaustive analysis of (3)\n\nCASE A.  p – q = 1.  \nEquation (3) becomes λ q = 48.  Because gcd(q , 1) = 1, every divisor q of 48 is allowed:\n\n        q ∈ {1, 2, 3, 4, 6, 8, 12, 16, 24, 48},  λ = 48 / q.     (5)\n\nPut p = q + 1.  Substituting p and λ in (1) gives\n\n        a₀ = λ(2q + 1), b₀ = 2λ q(q + 1), c   = λ(2q² + 2q + 1).     (6)\n\n(The sub-script 0 reminds us that these are “raw’’ legs; in the final table we swap them whenever b₀ < a₀, although this never happens in Case A.)\n\nCASE B.  p – q = 3.  \nNow (3) reads λ q = 48 / 3 = 16.  \nBecause gcd(q , 3) = 1, q must be a divisor of 16:\n\n        q ∈ {1, 2, 4, 8, 16},  λ = 16 / q.                     (7)\n\nPut p = q + 3; inserting in (1) yields\n\n        a₀ = λ·3(2q + 3) = λ(6q + 9),  \n        b₀ = 2λ q(q + 3),  \n        c   = λ(2q² + 6q + 9).                                    (8)\n\nHere b₀ can occasionally be smaller than a₀, so a final ordering step will be required.\n\nNo other values of p – q are possible by (4), so (6) together with (8) already parametrize all triangles whose area equals 24 times their perimeter.\n\nStep 5.  Explicit enumeration  \nFor each admissible q we compute (a₀ , b₀ , c) and finally write (a , b , c) with a ≤ b.\n\nA-series  (p – q = 1, λ q = 48)\n\n q   λ   (a , b , c)            Δ = gcd(a , b , c)\n 1   48  (144,  192,   240)      48\n 2   24  (120,  288,   312)      24\n 3   16  (112,  384,   400)      16\n 4   12  (108,  480,   492)      12\n 6    8  (104,  672,   680)       8\n 8    6  (102,  864,   870)       6\n12    4  (100, 1248,  1252)       4\n16    3   ( 99, 1632,  1635)      3\n24    2   ( 98, 2400,  2402)      2\n48    1   ( 97, 4704,  4705)      1  ← primitive\n\nB-series  (p – q = 3, λ q = 16)\n\n q   λ   (a , b , c)            Δ = gcd(a , b , c)\n 1   16  (128,  240,   272)      16\n 2    8  (160,  168,   232)       8\n 4    4  (132,  224,   260)       4\n 8    2  (114,  352,   370)       2\n16    1  (105,  608,   617)       1  ← primitive\n\nWe therefore obtain exactly 10 + 5 = 15 distinct integral right-angled triangles.\n\nStep 6.  Primitivity  \nBecause gcd(p , q) = 1, equation (1) shows that the common divisor of x , y , z is precisely λ.  Consequently the triple is primitive iff λ = 1.  Inspecting the tables we find precisely two such instances:\n\n• (97, 4704, 4705) (from the A-series, q = 48),  \n• (105, 608, 617) (from the B-series, q = 16).\n\nConclusion.  \nEquation (★) possesses exactly fifteen integral solutions, listed above, and exactly two of the corresponding triangles are primitive, namely (97, 4704, 4705) and (105, 608, 617).",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T01:37:45.459321",
        "was_fixed": false,
        "difficulty_analysis": "Compared with the original problem (“area = 2 × perimeter”) and the current kernel variant (“area = 8 × perimeter”), the enhanced variant raises the\ndifficulty in several independent ways.\n\n1.  The multiplicative constant 24 gives the core Diophantine constraint\n    λq(p–q)=48, whose factor structure (48 = 2⁴·3) is far richer than the\n    previous constants 4 and 16.  It forces a systematic case\n    decomposition that is impossible to guess by inspection.\n\n2.  Because 48 has ten divisors and the odd-divisor condition admits two\n    distinct gaps (p–q=1 and p–q=3), the solver must handle **two separate\n    sub-families**, each still containing several possibilities.  This\n    produces fifteen distinct triples instead of three or five, so mere\n    “pattern spotting’’ or trial–and–error is hopeless; a rigorous factor\n    analysis is unavoidable.\n\n3.  Verifying primitivity is no longer immediate but requires an additional\n    argument involving the exact role of the scaling parameter λ.\n\n4.  The solution seamlessly blends several classical techniques\n    (parametrisation of Pythagorean triples, parity arguments, coprimality\n    considerations, divisor counting) which interact non-trivially.  Each\n    step depends on previous observations, and skipping one of them breaks\n    the entire chain.\n\n5.  Finally, the task demands a complete *classification* (all 15 triples\n    explicitly listed) and a *second* classification (primitive vs.\n    non-primitive), greatly increasing both computational and conceptual\n    workload."
      }
    }
  },
  "checked": true,
  "problem_type": "proof",
  "iteratively_fixed": true
}