{
  "index": "2018-A-1",
  "type": "NT",
  "tag": [
    "NT",
    "ALG"
  ],
  "difficulty": "",
  "question": "Find all ordered pairs $(a,b)$ of positive integers for which\n\\[\n\\frac{1}{a} + \\frac{1}{b} = \\frac{3}{2018}.\n\\]",
  "solution": "By clearing denominators and regrouping, we see that the given equation is equivalent to \n\\[\n(3a-2018)(3b-2018) = 2018^2.\n\\]\nEach of the factors is congruent to $1 \\pmod 3$. There are $6$ positive factors of $2018^2 = 2^2 \\cdot 1009^2$ that are congruent to $1 \\pmod 3$: $1$, $2^2$, $1009$, $2^2 \\cdot 1009$, $1009^2$, $2^2 \\cdot 1009^2$. These lead to the $6$ possible pairs: $(a,b) = (673,1358114)$, $(674,340033)$, $(1009,2018)$, $(2018,1009)$, $(340033,674)$, and $(1358114,673)$.\n\nAs for negative factors, the ones that are congruent to $1 \\pmod 3$ are $-2, -2 \\cdot 1009, -2 \\cdot 1009^2$.\nHowever, all of these lead to pairs where $a \\leq 0$ or $b \\leq 0$.",
  "vars": [
    "a",
    "b"
  ],
  "params": [],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "a": "firstint",
        "b": "secondint"
      },
      "question": "Find all ordered pairs $(firstint,secondint)$ of positive integers for which\n\\[\n\\frac{1}{firstint} + \\frac{1}{secondint} = \\frac{3}{2018}.\n\\]",
      "solution": "By clearing denominators and regrouping, we see that the given equation is equivalent to \n\\[\n(3firstint-2018)(3secondint-2018) = 2018^2.\n\\]\nEach of the factors is congruent to $1 \\pmod 3$. There are $6$ positive factors of $2018^2 = 2^2 \\cdot 1009^2$ that are congruent to $1 \\pmod 3$: $1$, $2^2$, $1009$, $2^2 \\cdot 1009$, $1009^2$, $2^2 \\cdot 1009^2$. These lead to the $6$ possible pairs: $(firstint,secondint) = (673,1358114)$, $(674,340033)$, $(1009,2018)$, $(2018,1009)$, $(340033,674)$, and $(1358114,673)$.\n\nAs for negative factors, the ones that are congruent to $1 \\pmod 3$ are $-2, -2 \\cdot 1009, -2 \\cdot 1009^2$.\nHowever, all of these lead to pairs where $firstint \\leq 0$ or $secondint \\leq 0$. "
    },
    "descriptive_long_confusing": {
      "map": {
        "a": "carousel",
        "b": "lighthouse"
      },
      "question": "Find all ordered pairs $(carousel,lighthouse)$ of positive integers for which\n\\[\n\\frac{1}{carousel} + \\frac{1}{lighthouse} = \\frac{3}{2018}.\n\\]",
      "solution": "By clearing denominators and regrouping, we see that the given equation is equivalent to \n\\[\n(3carousel-2018)(3lighthouse-2018) = 2018^2.\n\\]\nEach of the factors is congruent to $1 \\pmod 3$. There are $6$ positive factors of $2018^2 = 2^2 \\cdot 1009^2$ that are congruent to $1 \\pmod 3$: $1$, $2^2$, $1009$, $2^2 \\cdot 1009$, $1009^2$, $2^2 \\cdot 1009^2$. These lead to the $6$ possible pairs: $(carousel,lighthouse) = (673,1358114)$, $(674,340033)$, $(1009,2018)$, $(2018,1009)$, $(340033,674)$, and $(1358114,673)$.\n\nAs for negative factors, the ones that are congruent to $1 \\pmod 3$ are $-2, -2 \\cdot 1009, -2 \\cdot 1009^2$.\nHowever, all of these lead to pairs where $carousel \\leq 0$ or $lighthouse \\leq 0$. "
    },
    "descriptive_long_misleading": {
      "map": {
        "a": "negativeint",
        "b": "nonpositive"
      },
      "question": "Find all ordered pairs $(negativeint,nonpositive)$ of positive integers for which\n\\[\n\\frac{1}{negativeint} + \\frac{1}{nonpositive} = \\frac{3}{2018}.\n\\]",
      "solution": "By clearing denominators and regrouping, we see that the given equation is equivalent to \n\\[\n(3negativeint-2018)(3nonpositive-2018) = 2018^2.\n\\]\nEach of the factors is congruent to $1 \\pmod 3$. There are $6$ positive factors of $2018^2 = 2^2 \\cdot 1009^2$ that are congruent to $1 \\pmod 3$: $1$, $2^2$, $1009$, $2^2 \\cdot 1009$, $1009^2$, $2^2 \\cdot 1009^2$. These lead to the $6$ possible pairs: $(negativeint,nonpositive) = (673,1358114)$, $(674,340033)$, $(1009,2018)$, $(2018,1009)$, $(340033,674)$, and $(1358114,673)$.\n\nAs for negative factors, the ones that are congruent to $1 \\pmod 3$ are $-2, -2 \\cdot 1009, -2 \\cdot 1009^2$.\nHowever, all of these lead to pairs where $negativeint \\leq 0$ or $nonpositive \\leq 0$. }。\n",
      "confidence": "'"
    },
    "garbled_string": {
      "map": {
        "a": "qzxwvtnp",
        "b": "hjgrksla"
      },
      "question": "Find all ordered pairs $(qzxwvtnp,hjgrksla)$ of positive integers for which\n\\[\n\\frac{1}{qzxwvtnp} + \\frac{1}{hjgrksla} = \\frac{3}{2018}.\n\\]",
      "solution": "By clearing denominators and regrouping, we see that the given equation is equivalent to \n\\[\n(3qzxwvtnp-2018)(3hjgrksla-2018) = 2018^2.\n\\]\nEach of the factors is congruent to $1 \\pmod 3$. There are $6$ positive factors of $2018^2 = 2^2 \\cdot 1009^2$ that are congruent to $1 \\pmod 3$: $1$, $2^2$, $1009$, $2^2 \\cdot 1009$, $1009^2$, $2^2 \\cdot 1009^2$. These lead to the $6$ possible pairs: $(qzxwvtnp,hjgrksla) = (673,1358114)$, $(674,340033)$, $(1009,2018)$, $(2018,1009)$, $(340033,674)$, and $(1358114,673)$.\n\nAs for negative factors, the ones that are congruent to $1 \\pmod 3$ are $-2, -2 \\cdot 1009, -2 \\cdot 1009^2$.\nHowever, all of these lead to pairs where $qzxwvtnp \\leq 0$ or $hjgrksla \\leq 0$. "
    },
    "kernel_variant": {
      "question": "Determine all ordered pairs \\((a,b)\\) of positive integers that satisfy\n\\[\n\\frac1a+\\frac1b=\\frac{4}{2023}.\n\\]",
      "solution": "Clear denominators:\n\n  1/a + 1/b = 4/2023  ⇔  2023(a + b) = 4ab.\n\nMultiply both sides by 4 and bring all terms to one side:\n\n  16ab – 8092a – 8092b = 0.\n\nAdd 2023^2 to both sides and factor:\n\n  16ab – 8092a – 8092b + 2023^2 = 2023^2\n  ⇒ (4a – 2023)(4b – 2023) = 2023^2.   (1)\n\nStep 1.  Since 2023 ≡ 3 (mod 4), we have\n\n  4a – 2023 ≡ 1 (mod 4),   4b – 2023 ≡ 1 (mod 4).\n\nHence in (1) each factor must be ≡1 mod 4.\n\nStep 2.  Factorization of 2023^2:\n\n  2023 = 7·17^2,   so   2023^2 = 7^2 · 17^4.\n\nA positive divisor is d = 7^α 17^β,  0 ≤ α ≤ 2,  0 ≤ β ≤ 4.  Since 7 ≡ 3 (mod 4) and 17 ≡ 1 (mod 4),\n\n  d ≡ 3^α (mod 4),\n\nso d ≡ 1 (mod 4) exactly when α = 0 or 2.  There are 2·5 = 10 such divisors:\n\n  1, 17, 289, 4913, 83521,\n   49, 833, 14161, 240737, 4092529.\n\nStep 3.  For each such d set\n\n  4a – 2023 = d,   4b – 2023 = 2023^2/d.\n\nThen\n\n  a = (d + 2023)/4,\n  b = (2023^2/d + 2023)/4\n\nare integers and positive.  Computing gives the ten ordered pairs\n\n  (506, 1023638), (510, 60690), (578, 4046), (1734, 714), (21386, 518),\n  (518, 21386), (714, 1734), (4046, 578), (60690, 510), (1023638, 506).\n\nStep 4.  No other positive solutions arise.  Hence these are all the ordered pairs (a,b) satisfying\n\n  1/a + 1/b = 4/2023.",
      "_meta": {
        "core_steps": [
          "Clear denominators to rewrite 1/a + 1/b = 3/2018 as (3a−2018)(3b−2018)=2018²",
          "Observe that each factor (3a−2018) and (3b−2018) is congruent to 1 (mod 3)",
          "Factor 2018² into primes and list its divisors that are 1 (mod 3)",
          "Match every such divisor d with its complementary divisor 2018²/d to obtain 3a−2018=d, 3b−2018=2018²/d",
          "Keep only the pairs giving positive integers a,b"
        ],
        "mutable_slots": {
          "slot1": {
            "description": "Numerator of the right-hand fraction; becomes the modulus in the congruence test",
            "original": 3
          },
          "slot2": {
            "description": "Denominator of the right-hand fraction; its square appears on the right after clearing denominators",
            "original": 2018
          },
          "slot3": {
            "description": "Prime factorisation of the denominator (affects the divisor enumeration)",
            "original": "2018 = 2 · 1009"
          },
          "slot4": {
            "description": "Residue of the denominator modulo the numerator (controls which divisors are admissible)",
            "original": "2018 ≡ 2 (mod 3) ⇒ admissible divisors ≡ 1 (mod 3)"
          },
          "slot5": {
            "description": "Number of admissible positive divisors that survive the congruence filter (gives the final count of solutions)",
            "original": 6
          }
        }
      }
    }
  },
  "checked": true,
  "problem_type": "calculation"
}