{
  "index": "1973-B-3",
  "type": "NT",
  "tag": [
    "NT",
    "ALG"
  ],
  "difficulty": "",
  "question": "B-3. Consider an integer \\( p>1 \\) with the property that the polynomial \\( x^{2}-x+p \\) takes prime values for all integers \\( x \\) in the range \\( 0 \\leqq x<p \\). (Examples: \\( p=5 \\) and \\( p=41 \\) have this property.) Show that there is exactly one triple of integers \\( a, b, c \\) satisfying the conditions:\n\\[\n\\begin{array}{r}\nb^{2}-4 a c=1-4 p \\\\\n0<a \\leqq c \\\\\n-a \\leqq b<a\n\\end{array}\n\\]",
  "solution": "B-3. One triple \\( (a, b, c) \\) satisfying the conditions is \\( (1,-1, p) \\); it remains to show that this is the only solution. Clearly \\( b \\) must be odd since \\( b^{2} \\equiv 1(\\bmod 4) \\). Also \\( b^{2}=(-b)^{2} \\), so write \\( |b|=2 x-1 \\). Then \\( b^{2}-4 a c=1-4 p \\) gives\n\\[\nx^{2}-x+p=a c\n\\]\n\nIf \\( 0 \\leqq x<p \\), the hypothesis tells us that \\( a c \\) is prime; then \\( 0<a \\leqq c \\) implies that \\( a=1 \\), it follows from \\( -a \\leqq b<a \\) and the oddness of \\( b \\) that \\( b=-1 \\), and \\( 1-4 p=b^{2}-4 a c=1-4 c \\) gives us \\( c=p \\). Since \\( x=(|b|+1) / 2 \\geqq 0 \\), it suffices to show that \\( x<p \\). Since \\( |b| \\leqq a \\leqq c, b^{2}-4 a c=1-4 p \\), and \\( p \\geqq 2 \\), one sees that \\( x<p \\) using\n\\[\n\\begin{aligned}\n3 a^{2} & =4 a^{2}-a^{2} \\leqq 4 a c-b^{2}=4 p-1 \\\\\n|b| & \\leqq a \\leqq \\sqrt{(4 p-1) / 3} \\\\\nx & =(|b|+1) / 2<\\sqrt{p / 3}+(1 / 2)<p\n\\end{aligned}\n\\]",
  "vars": [
    "x",
    "a",
    "b",
    "c"
  ],
  "params": [
    "p"
  ],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "x": "integerx",
        "a": "coefficienta",
        "b": "parameterb",
        "c": "coefficientc",
        "p": "primebase"
      },
      "question": "B-3. Consider an integer \\( primebase>1 \\) with the property that the polynomial \\( integerx^{2}-integerx+primebase \\) takes prime values for all integers \\( integerx \\) in the range \\( 0 \\leqq integerx<primebase \\). (Examples: \\( primebase=5 \\) and \\( primebase=41 \\) have this property.) Show that there is exactly one triple of integers \\( coefficienta, parameterb, coefficientc \\) satisfying the conditions:\n\\[\n\\begin{array}{r}\nparameterb^{2}-4 coefficienta coefficientc=1-4 primebase \\\\\n0<coefficienta \\leqq coefficientc \\\\\n-coefficienta \\leqq parameterb<coefficienta\n\\end{array}\n\\]",
      "solution": "B-3. One triple \\( (coefficienta, parameterb, coefficientc) \\) satisfying the conditions is \\( (1,-1, primebase) \\); it remains to show that this is the only solution. Clearly \\( parameterb \\) must be odd since \\( parameterb^{2} \\equiv 1(\\bmod 4) \\). Also \\( parameterb^{2}=(-parameterb)^{2} \\), so write \\( |parameterb|=2 integerx-1 \\). Then \\( parameterb^{2}-4 coefficienta coefficientc=1-4 primebase \\) gives\n\\[\nintegerx^{2}-integerx+primebase=coefficienta coefficientc\n\\]\n\nIf \\( 0 \\leqq integerx<primebase \\), the hypothesis tells us that \\( coefficienta coefficientc \\) is prime; then \\( 0<coefficienta \\leqq coefficientc \\) implies that \\( coefficienta=1 \\), it follows from \\( -coefficienta \\leqq parameterb<coefficienta \\) and the oddness of \\( parameterb \\) that \\( parameterb=-1 \\), and \\( 1-4 primebase=parameterb^{2}-4 coefficienta coefficientc=1-4 coefficientc \\) gives us \\( coefficientc=primebase \\). Since \\( integerx=(|parameterb|+1) / 2 \\geqq 0 \\), it suffices to show that \\( integerx<primebase \\). Since \\( |parameterb| \\leqq coefficienta \\leqq coefficientc, parameterb^{2}-4 coefficienta coefficientc=1-4 primebase \\), and \\( primebase \\geqq 2 \\), one sees that \\( integerx<primebase \\) using\n\\[\n\\begin{aligned}\n3 coefficienta^{2} & =4 coefficienta^{2}-coefficienta^{2} \\leqq 4 coefficienta coefficientc-parameterb^{2}=4 primebase-1 \\\\\n|parameterb| & \\leqq coefficienta \\leqq \\sqrt{(4 primebase-1) / 3} \\\\\nintegerx & =(|parameterb|+1) / 2<\\sqrt{primebase / 3}+(1 / 2)<primebase\n\\end{aligned}\n\\]\n"
    },
    "descriptive_long_confusing": {
      "map": {
        "x": "lavender",
        "a": "pendulum",
        "b": "goldcrest",
        "c": "stoneware",
        "p": "afterglow"
      },
      "question": "B-3. Consider an integer \\( afterglow>1 \\) with the property that the polynomial \\( lavender^{2}-lavender+afterglow \\) takes prime values for all integers \\( lavender \\) in the range \\( 0 \\leqq lavender<afterglow \\). (Examples: \\( afterglow=5 \\) and \\( afterglow=41 \\) have this property.) Show that there is exactly one triple of integers \\( pendulum, goldcrest, stoneware \\) satisfying the conditions:\n\\[\n\\begin{array}{r}\ngoldcrest^{2}-4\\,pendulum\\,stoneware=1-4\\,afterglow \\\\\n0<pendulum \\leqq stoneware \\\\\n-pendulum \\leqq goldcrest<pendulum\n\\end{array}\n\\]",
      "solution": "B-3. One triple \\( (pendulum, goldcrest, stoneware) \\) satisfying the conditions is \\( (1,-1, afterglow) \\); it remains to show that this is the only solution. Clearly \\( goldcrest \\) must be odd since \\( goldcrest^{2} \\equiv 1(\\bmod 4) \\). Also \\( goldcrest^{2}=(-goldcrest)^{2} \\), so write \\( |goldcrest|=2 lavender-1 \\). Then \\( goldcrest^{2}-4 pendulum stoneware=1-4 afterglow \\) gives\n\\[\nlavender^{2}-lavender+afterglow=pendulum stoneware\n\\]\n\nIf \\( 0 \\leqq lavender<afterglow \\), the hypothesis tells us that \\( pendulum stoneware \\) is prime; then \\( 0<pendulum \\leqq stoneware \\) implies that \\( pendulum=1 \\), it follows from \\( -pendulum \\leqq goldcrest<pendulum \\) and the oddness of \\( goldcrest \\) that \\( goldcrest=-1 \\), and \\( 1-4 afterglow=goldcrest^{2}-4 pendulum stoneware=1-4 stoneware \\) gives us \\( stoneware=afterglow \\). Since \\( lavender=(|goldcrest|+1) / 2 \\geqq 0 \\), it suffices to show that \\( lavender<afterglow \\). Since \\( |goldcrest| \\leqq pendulum \\leqq stoneware, goldcrest^{2}-4 pendulum stoneware=1-4 afterglow \\), and \\( afterglow \\geqq 2 \\), one sees that \\( lavender<afterglow \\) using\n\\[\n\\begin{aligned}\n3\\,pendulum^{2} & =4\\,pendulum^{2}-pendulum^{2} \\leqq 4\\,pendulum\\,stoneware-goldcrest^{2}=4\\,afterglow-1 \\\\\n|goldcrest| & \\leqq pendulum \\leqq \\sqrt{(4\\,afterglow-1) / 3} \\\\\nlavender & =( |goldcrest|+1) / 2<\\sqrt{afterglow / 3}+(1 / 2)<afterglow\n\\end{aligned}\n\\]"
    },
    "descriptive_long_misleading": {
      "map": {
        "x": "invariant",
        "a": "resultval",
        "b": "evenvalue",
        "c": "minimalval",
        "p": "compositenumber"
      },
      "question": "B-3. Consider an integer \\( compositenumber>1 \\) with the property that the polynomial \\( invariant^{2}-invariant+compositenumber \\) takes prime values for all integers \\( invariant \\) in the range \\( 0 \\leqq invariant<compositenumber \\). (Examples: \\( compositenumber=5 \\) and \\( compositenumber=41 \\) have this property.) Show that there is exactly one triple of integers \\( resultval, evenvalue, minimalval \\) satisfying the conditions:\n\\[\n\\begin{array}{r}\nevenvalue^{2}-4 resultval minimalval=1-4 compositenumber \\\\\n0<resultval \\leqq minimalval \\\\\n-resultval \\leqq evenvalue<resultval\n\\end{array}\n\\]",
      "solution": "B-3. One triple \\( (resultval, evenvalue, minimalval) \\) satisfying the conditions is \\( (1,-1, compositenumber) \\); it remains to show that this is the only solution. Clearly \\( evenvalue \\) must be odd since \\( evenvalue^{2} \\equiv 1(\\bmod 4) \\). Also \\( evenvalue^{2}=(-evenvalue)^{2} \\), so write \\( |evenvalue|=2 invariant-1 \\). Then \\( evenvalue^{2}-4 resultval minimalval=1-4 compositenumber \\) gives\n\\[\ninvariant^{2}-invariant+compositenumber=resultval minimalval\n\\]\n\nIf \\( 0 \\leqq invariant<compositenumber \\), the hypothesis tells us that \\( resultval minimalval \\) is prime; then \\( 0<resultval \\leqq minimalval \\) implies that \\( resultval=1 \\), it follows from \\( -resultval \\leqq evenvalue<resultval \\) and the oddness of \\( evenvalue \\) that \\( evenvalue=-1 \\), and \\( 1-4 compositenumber=evenvalue^{2}-4 resultval minimalval=1-4 minimalval \\) gives us \\( minimalval=compositenumber \\). Since \\( invariant=(|evenvalue|+1) / 2 \\geqq 0 \\), it suffices to show that \\( invariant<compositenumber \\). Since \\( |evenvalue| \\leqq resultval \\leqq minimalval, evenvalue^{2}-4 resultval minimalval=1-4 compositenumber \\), and \\( compositenumber \\geqq 2 \\), one sees that \\( invariant<compositenumber \\) using\n\\[\n\\begin{aligned}\n3 resultval^{2} & =4 resultval^{2}-resultval^{2} \\leqq 4 resultval minimalval-evenvalue^{2}=4 compositenumber-1 \\\\\n|evenvalue| & \\leqq resultval \\leqq \\sqrt{(4 compositenumber-1) / 3} \\\\\ninvariant & =( |evenvalue|+1 ) / 2<\\sqrt{compositenumber / 3}+(1 / 2)<compositenumber\n\\end{aligned}\n\\]"
    },
    "garbled_string": {
      "map": {
        "x": "florpqzn",
        "a": "turbzigg",
        "b": "mastruvy",
        "c": "blonkred",
        "p": "zimthwex"
      },
      "question": "B-3. Consider an integer \\( zimthwex>1 \\) with the property that the polynomial \\( florpqzn^{2}-florpqzn+zimthwex \\) takes prime values for all integers \\( florpqzn \\) in the range \\( 0 \\leqq florpqzn<zimthwex \\). (Examples: \\( zimthwex=5 \\) and \\( zimthwex=41 \\) have this property.) Show that there is exactly one triple of integers \\( turbzigg, mastruvy, blonkred \\) satisfying the conditions:\n\\[\n\\begin{array}{r}\nmastruvy^{2}-4 turbzigg blonkred=1-4 zimthwex \\\\\n0<turbzigg \\leqq blonkred \\\\\n-turbzigg \\leqq mastruvy<turbzigg\n\\end{array}\n\\]\n",
      "solution": "B-3. One triple \\( (turbzigg, mastruvy, blonkred) \\) satisfying the conditions is \\( (1,-1, zimthwex) \\); it remains to show that this is the only solution. Clearly \\( mastruvy \\) must be odd since \\( mastruvy^{2} \\equiv 1(\\bmod 4) \\). Also \\( mastruvy^{2}=(-mastruvy)^{2} \\), so write \\( |mastruvy|=2 florpqzn-1 \\). Then \\( mastruvy^{2}-4 turbzigg blonkred=1-4 zimthwex \\) gives\n\\[\nflorpqzn^{2}-florpqzn+zimthwex=turbzigg blonkred\n\\]\n\nIf \\( 0 \\leqq florpqzn<zimthwex \\), the hypothesis tells us that \\( turbzigg blonkred \\) is prime; then \\( 0<turbzigg \\leqq blonkred \\) implies that \\( turbzigg=1 \\), it follows from \\( -turbzigg \\leqq mastruvy<turbzigg \\) and the oddness of \\( mastruvy \\) that \\( mastruvy=-1 \\), and \\( 1-4 zimthwex=mastruvy^{2}-4 turbzigg blonkred=1-4 blonkred \\) gives us \\( blonkred=zimthwex \\). Since \\( florpqzn=(|mastruvy|+1) / 2 \\geqq 0 \\), it suffices to show that \\( florpqzn<zimthwex \\). Since \\( |mastruvy| \\leqq turbzigg \\leqq blonkred, mastruvy^{2}-4 turbzigg blonkred=1-4 zimthwex \\), and \\( zimthwex \\geqq 2 \\), one sees that \\( florpqzn<zimthwex \\) using\n\\[\n\\begin{aligned}\n3 turbzigg^{2} & =4 turbzigg^{2}-turbzigg^{2} \\leqq 4 turbzigg blonkred-mastruvy^{2}=4 zimthwex-1 \\\\\n|mastruvy| & \\leqq turbzigg \\leqq \\sqrt{(4 zimthwex-1) / 3} \\\\\nflorpqzn & =( |mastruvy|+1 ) / 2<\\sqrt{zimthwex / 3}+(1 / 2)<zimthwex\n\\end{aligned}\n\\]\n"
    },
    "kernel_variant": {
      "question": "Let p > 1 be an integer for which the polynomial\n  \n          x² − x + p\n  \nassumes a prime value for every integer x in the range 0 ≤ x < p (for example, p = 5 and p = 41 have this property).\nProve that there is exactly one triple of integers (a, b, c) that satisfies\n  \n          b² − 4ac = 1 − 4p ,\n          0 < a ≤ c ,\n          –a ≤ b < a .",
      "solution": "We show that the unique solution of\n  \n          b² − 4ac = 1 − 4p                 (1)\n          0 < a ≤ c ,                       (2)\n          –a ≤ b < a                        (3)\n  \nis (a, b, c) = (1, –1, p).\n\nStep 1.  Parity of b.\nReducing (1) mod 4 gives b² ≡ 1 (mod 4); hence b is odd.  Write\n          |b| = 2x − 1        (x ≥ 1,  x ∈ ℤ).         (4)\n\nStep 2.  Express ac in terms of x.\nSubstituting b² = (2x − 1)² = 4x² − 4x + 1 in (1) yields\n          (4x² − 4x + 1) − 4ac = 1 − 4p\n  ⇒       4x² − 4x          = 4(ac − p)\n  ⇒       x² − x + p        = ac.                       (5)\n\nStep 3.  Bring the primality hypothesis into play.\nBecause 0 ≤ x = (|b| + 1)/2 < p will shortly be proved (see Step 4), the\nhypothesis tells us that the number on the left of (5) is prime.  As\n(a, c) are positive integers with a ≤ c, their product ac equals that\nprime only when a = 1 and c = x² − x + p.  With a = 1, condition (3)\nforces b = −1 because b is odd and –1 ≤ b < 1.  Finally, inserting\n(a, b) = (1, −1) into (1) gives\n          1 − 4·1·c = 1 − 4p  ⇒  c = p.                (6)\nThus (a, b, c) = (1, −1, p) is the only possible solution; it remains\nonly to validate the claim x < p used above.\n\nStep 4.  Bounding x.\nRewrite (1) as\n          4ac − b² = 4p − 1.                          (7)\nUsing (2) and (3) we have c ≥ a > 0 and |b| ≤ a, so\n          4ac − b² ≥ 4a² − a² = 3a².                  (8)\nConsequently 3a² ≤ 4p − 1, whence\n          a ≤ √((4p − 1)/3).                          (9)\nFrom (4) and (3) we get |b| ≤ a, so\n          x = (|b| + 1)/2 ≤ (a + 1)/2 <\n              ( √((4p − 1)/3) + 1 )/2.               (10)\nFor all p ≥ 2 one checks\n          √((4p − 1)/3) < p,                          (11)\nso the right-hand side of (10) is < (p + 1)/2 < p.\nTherefore x < p as promised, and Step 3 is justified.\n\nConclusion.  The only triple (a, b, c) fulfilling (1)–(3) is\n              (a, b, c) = (1, –1, p).\nHence uniqueness is proved.",
      "_meta": {
        "core_steps": [
          "Parity: from b² ≡ 1 (mod 4) deduce b is odd and write |b| = 2x − 1.",
          "Rewrite the given equation to get ac = x² − x + p.",
          "If x < p the hypothesis makes ac prime; with 0 < a ≤ c this forces a = 1, then −a ≤ b < a gives b = −1 and hence c = p.",
          "Therefore it suffices to prove x < p.",
          "Use |b| ≤ a ≤ c and b² − 4ac = 1 − 4p < 0 to bound a, |b| and then x, obtaining x < p."
        ],
        "mutable_slots": {
          "slot1": {
            "description": "The constant multiplier 4 that appears in both b² − 4ac and 1 − 4p (i.e. the coefficient of ac and p).  Any even integer k > 2 would let the same chain of inequalities go through after trivial rescaling.",
            "original": "4"
          },
          "slot2": {
            "description": "The inclusion of x = 0 in the prime–producing range 0 ≤ x < p.  Since the proof only ever uses x ≥ 1, the lower bound could be raised (e.g. 1 ≤ x < p) without affecting the argument.",
            "original": "lower limit 0 in 0 ≤ x < p"
          }
        }
      }
    }
  },
  "checked": true,
  "problem_type": "proof",
  "iteratively_fixed": true
}