{
  "index": "1958-2-A-7",
  "type": "NT",
  "tag": [
    "NT",
    "ANA"
  ],
  "difficulty": "",
  "question": "7. Let \\( a \\) and \\( b \\) be relatively prime positive integers, \\( b \\) even. For each positive integer \\( q \\) let \\( p=p(q) \\) be chosen so that\n\\[\n\\left|\\frac{p}{q}-\\frac{a}{b}\\right|\n\\]\nis a minimum. Prove that\n\\[\n\\lim _{n-\\infty} \\sum_{y=1}^{n} \\frac{q\\left|\\frac{p}{q}-\\frac{a}{b}\\right|}{n}=\\frac{1}{4} .\n\\]",
  "solution": "Solution. Rewrite \\( q|p / q-a / b| \\) in the form\n\\[\n\\frac{1}{b}|p b-q a| .\n\\]\n\nFor each \\( q \\) we are to choose \\( p \\) to minimize this; then \\( p b \\) - \\( q a \\) will be the absolutely least residue of \\( q a \\) modulo \\( b \\). Since \\( a \\) is relatively prime to \\( b \\), as \\( q \\) varies through a complete set of residues modulo \\( b \\), so will \\( q a \\), and therefore \\( p b-q a \\) will take the values\n\\[\n-C+1,-C+2, \\ldots-1,0,1, \\ldots, C-1, C\n\\]\nwhere \\( b=2 C \\) (recall that \\( b \\) is even) and the contribution to the sum will be\n\\[\n\\begin{aligned}\n\\frac{1}{b}(0+1+2+\\cdots+ & C-1+C+C-1+\\cdots+1) \\\\\n& =\\frac{C^{2}}{2 C}=b / 4\n\\end{aligned}\n\\]\n\nThus if \\( n=b \\cdot r+s \\) where \\( 0 \\leq s<b \\), we have\n\\[\n\\sum_{q=1}^{n} q\\left|\\frac{p}{q}-\\frac{a}{b}\\right|=r \\frac{b}{4}+\\sum_{q=b r+1}^{b r+s} q\\left|\\frac{p}{q}-\\frac{a}{b}\\right|\n\\]\nsince \\( q \\) runs through \\( r \\) complete residue systems \\( (\\bmod b) \\) and then the integers \\( b r+1, b r+2, \\ldots, b r+s \\). Since \\( p(q) \\) is the integer nearest to \\( q a / b \\),\n\\[\nq\\left|\\frac{p}{q}-\\frac{a}{b}\\right|=\\left|p-\\frac{q a}{b}\\right| \\leq \\frac{1}{2}\n\\]\n\nWe have therefore\n\\[\n\\begin{aligned}\n\\left|\\frac{1}{4} n-\\sum_{q=1}^{n} q\\right| \\frac{p}{q}-\\frac{a}{b}| | & =\\left|\\frac{s}{4}-\\sum_{q=b r+1}^{b r+s} q\\right| \\frac{p}{q}-\\frac{a}{b}| | . \\\\\n& \\leq \\frac{s}{4}+s \\sup _{q} q\\left|\\frac{p}{q}-\\frac{a}{b}\\right| \\\\\n& \\leq \\frac{3}{4} s<\\frac{3}{4} b .\n\\end{aligned}\n\\]\n\nDividing by \\( n \\), we get\n\\[\n\\left|\\frac{1}{4}-\\frac{1}{n} \\sum_{q=1}^{n} q\\right| \\frac{p}{q}-\\frac{a}{b}| |<\\frac{3 b}{4 n} .\n\\]\n\nLetting \\( n \\rightarrow \\infty \\), we see that\n\\[\n\\lim _{n \\rightarrow \\infty} \\frac{1}{n} \\sum_{q=1}^{n} q\\left|\\frac{p}{q}-\\frac{a}{b}\\right|=\\frac{1}{4} .\n\\]",
  "vars": [
    "q",
    "p",
    "n",
    "y",
    "r",
    "s"
  ],
  "params": [
    "a",
    "b",
    "C"
  ],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "q": "denomiter",
        "p": "nearintg",
        "n": "termlimit",
        "y": "sumindex",
        "r": "quotcount",
        "s": "remablock",
        "a": "numerrel",
        "b": "evenrel",
        "C": "halfdeno"
      },
      "question": "7. Let \\( numerrel \\) and \\( evenrel \\) be relatively prime positive integers, \\( evenrel \\) even. For each positive integer \\( denomiter \\) let \\( nearintg=nearintg(denomiter) \\) be chosen so that\n\\[\n\\left|\\frac{nearintg}{denomiter}-\\frac{numerrel}{evenrel}\\right|\n\\]\nis a minimum. Prove that\n\\[\n\\lim _{termlimit-\\infty} \\sum_{sumindex=1}^{termlimit} \\frac{denomiter\\left|\\frac{nearintg}{denomiter}-\\frac{numerrel}{evenrel}\\right|}{termlimit}=\\frac{1}{4} .\n\\]",
      "solution": "Solution. Rewrite \\( denomiter|nearintg / denomiter-numerrel / evenrel| \\) in the form\n\\[\n\\frac{1}{evenrel}|nearintg\\,evenrel-denomiter\\,numerrel| .\n\\]\n\nFor each \\( denomiter \\) we are to choose \\( nearintg \\) to minimize this; then \\( nearintg\\,evenrel-denomiter\\,numerrel \\) will be the absolutely least residue of \\( denomiter\\,numerrel \\) modulo \\( evenrel \\). Since \\( numerrel \\) is relatively prime to \\( evenrel \\), as \\( denomiter \\) varies through a complete set of residues modulo \\( evenrel \\), so will \\( denomiter\\,numerrel \\), and therefore \\( nearintg\\,evenrel-denomiter\\,numerrel \\) will take the values\n\\[\n-halfdeno+1,-halfdeno+2, \\ldots-1,0,1, \\ldots, halfdeno-1, halfdeno\n\\]\nwhere \\( evenrel=2\\,halfdeno \\) (recall that \\( evenrel \\) is even) and the contribution to the sum will be\n\\[\n\\begin{aligned}\n\\frac{1}{evenrel}(0+1+2+\\cdots+ & halfdeno-1+halfdeno+halfdeno-1+\\cdots+1) \\\\\n& =\\frac{halfdeno^{2}}{2\\,halfdeno}=evenrel / 4\n\\end{aligned}\n\\]\n\nThus if \\( termlimit=evenrel \\cdot quotcount+remablock \\) where \\( 0 \\leq remablock<evenrel \\), we have\n\\[\n\\sum_{denomiter=1}^{termlimit} denomiter\\left|\\frac{nearintg}{denomiter}-\\frac{numerrel}{evenrel}\\right|=quotcount \\frac{evenrel}{4}+\\sum_{denomiter=evenrel\\,quotcount+1}^{evenrel\\,quotcount+remablock} denomiter\\left|\\frac{nearintg}{denomiter}-\\frac{numerrel}{evenrel}\\right|\n\\]\nsince \\( denomiter \\) runs through \\( quotcount \\) complete residue systems \\((\\bmod evenrel)\\) and then the integers \\( evenrel\\,quotcount+1, evenrel\\,quotcount+2, \\ldots, evenrel\\,quotcount+remablock \\). Since \\( nearintg(denomiter) \\) is the integer nearest to \\( denomiter\\,numerrel / evenrel \\),\n\\[\ndenomiter\\left|\\frac{nearintg}{denomiter}-\\frac{numerrel}{evenrel}\\right|=\\left|nearintg-\\frac{denomiter\\,numerrel}{evenrel}\\right| \\leq \\frac{1}{2}\n\\]\n\nWe have therefore\n\\[\n\\begin{aligned}\n\\left|\\frac{1}{4} termlimit-\\sum_{denomiter=1}^{termlimit} denomiter\\right| \\frac{nearintg}{denomiter}-\\frac{numerrel}{evenrel}| | & =\\left|\\frac{remablock}{4}-\\sum_{denomiter=evenrel\\,quotcount+1}^{evenrel\\,quotcount+remablock} denomiter\\right| \\frac{nearintg}{denomiter}-\\frac{numerrel}{evenrel}| | . \\\\\n& \\leq \\frac{remablock}{4}+remablock \\sup _{denomiter} denomiter\\left|\\frac{nearintg}{denomiter}-\\frac{numerrel}{evenrel}\\right| \\\\\n& \\leq \\frac{3}{4} remablock<\\frac{3}{4} evenrel .\n\\end{aligned}\n\\]\n\nDividing by \\( termlimit \\), we get\n\\[\n\\left|\\frac{1}{4}-\\frac{1}{termlimit} \\sum_{denomiter=1}^{termlimit} denomiter\\right| \\frac{nearintg}{denomiter}-\\frac{numerrel}{evenrel}| |<\\frac{3\\,evenrel}{4\\,termlimit} .\n\\]\n\nLetting \\( termlimit \\rightarrow \\infty \\), we see that\n\\[\n\\lim _{termlimit \\rightarrow \\infty} \\frac{1}{termlimit} \\sum_{denomiter=1}^{termlimit} denomiter\\left|\\frac{nearintg}{denomiter}-\\frac{numerrel}{evenrel}\\right|=\\frac{1}{4} .\n\\]\n"
    },
    "descriptive_long_confusing": {
      "map": {
        "q": "shoreline",
        "p": "tapestry",
        "n": "hazelnuts",
        "y": "corridor",
        "r": "gemstone",
        "s": "lighthouse",
        "a": "riverbank",
        "b": "thunderous",
        "C": "monument"
      },
      "question": "7. Let \\( riverbank \\) and \\( thunderous \\) be relatively prime positive integers, \\( thunderous \\) even. For each positive integer \\( shoreline \\) let \\( tapestry=tapestry(shoreline) \\) be chosen so that\n\\[\n\\left|\\frac{tapestry}{shoreline}-\\frac{riverbank}{thunderous}\\right|\n\\]\nis a minimum. Prove that\n\\[\n\\lim _{hazelnuts-\\infty} \\sum_{corridor=1}^{hazelnuts} \\frac{shoreline\\left|\\frac{tapestry}{shoreline}-\\frac{riverbank}{thunderous}\\right|}{hazelnuts}=\\frac{1}{4} .\n\\]",
      "solution": "Solution. Rewrite \\( shoreline|tapestry / shoreline-riverbank / thunderous| \\) in the form\n\\[\n\\frac{1}{thunderous}|tapestry\\, thunderous-\\, shoreline\\, riverbank| .\n\\]\n\nFor each \\( shoreline \\) we are to choose \\( tapestry \\) to minimize this; then \\( tapestry\\, thunderous-\\, shoreline\\, riverbank \\) will be the absolutely least residue of \\( shoreline\\, riverbank \\) modulo \\( thunderous \\). Since \\( riverbank \\) is relatively prime to \\( thunderous \\), as \\( shoreline \\) varies through a complete set of residues modulo \\( thunderous \\), so will \\( shoreline\\, riverbank \\), and therefore \\( tapestry\\, thunderous-shoreline\\, riverbank \\) will take the values\n\\[\n-monument+1,-monument+2, \\ldots-1,0,1, \\ldots, monument-1, monument\n\\]\nwhere \\( thunderous=2 monument \\) (recall that \\( thunderous \\) is even) and the contribution to the sum will be\n\\[\n\\begin{aligned}\n\\frac{1}{thunderous}(0+1+2+\\cdots+ & monument-1+monument+monument-1+\\cdots+1) \\\\\n& =\\frac{monument^{2}}{2 monument}=thunderous / 4\n\\end{aligned}\n\\]\n\nThus if \\( hazelnuts=thunderous \\cdot gemstone+lighthouse \\) where \\( 0 \\leq lighthouse<thunderous \\), we have\n\\[\n\\sum_{shoreline=1}^{hazelnuts} shoreline\\left|\\frac{tapestry}{shoreline}-\\frac{riverbank}{thunderous}\\right|=gemstone \\frac{thunderous}{4}+\\sum_{shoreline=thunderous\\, gemstone+1}^{thunderous\\, gemstone+lighthouse} shoreline\\left|\\frac{tapestry}{shoreline}-\\frac{riverbank}{thunderous}\\right|\n\\]\nsince \\( shoreline \\) runs through \\( gemstone \\) complete residue systems \\( (\\bmod thunderous) \\) and then the integers \\( thunderous\\, gemstone+1, thunderous\\, gemstone+2, \\ldots, thunderous\\, gemstone+lighthouse \\). Since \\( tapestry(shoreline) \\) is the integer nearest to \\( \\dfrac{shoreline\\, riverbank}{thunderous} \\),\n\\[\nshoreline\\left|\\frac{tapestry}{shoreline}-\\frac{riverbank}{thunderous}\\right|=\\left|tapestry-\\frac{shoreline\\, riverbank}{thunderous}\\right| \\le \\frac{1}{2}\n\\]\n\nWe have therefore\n\\[\n\\begin{aligned}\n\\left|\\frac{1}{4}\\, hazelnuts-\\sum_{shoreline=1}^{hazelnuts} shoreline\\right|\\frac{tapestry}{shoreline}-\\frac{riverbank}{thunderous}|\\,| & =\\left|\\frac{lighthouse}{4}-\\sum_{shoreline=thunderous\\, gemstone+1}^{thunderous\\, gemstone+lighthouse} shoreline\\right|\\frac{tapestry}{shoreline}-\\frac{riverbank}{thunderous}|\\,| \\\\\n& \\le \\frac{lighthouse}{4}+lighthouse\\, \\sup_{shoreline} shoreline\\left|\\frac{tapestry}{shoreline}-\\frac{riverbank}{thunderous}\\right| \\\\\n& \\le \\frac{3}{4}\\, lighthouse<\\frac{3}{4}\\, thunderous .\n\\end{aligned}\n\\]\n\nDividing by \\( hazelnuts \\), we get\n\\[\n\\left|\\frac{1}{4}-\\frac{1}{hazelnuts}\\sum_{shoreline=1}^{hazelnuts} shoreline\\right|\\frac{tapestry}{shoreline}-\\frac{riverbank}{thunderous}|\\,|<\\frac{3\\, thunderous}{4\\, hazelnuts} .\n\\]\n\nLetting \\( hazelnuts \\rightarrow \\infty \\), we see that\n\\[\n\\lim_{hazelnuts \\rightarrow \\infty} \\frac{1}{hazelnuts} \\sum_{shoreline=1}^{hazelnuts} shoreline\\left|\\frac{tapestry}{shoreline}-\\frac{riverbank}{thunderous}\\right|=\\frac{1}{4} .\n\\]"
    },
    "descriptive_long_misleading": {
      "map": {
        "q": "constantval",
        "p": "randomized",
        "n": "fractional",
        "y": "fixedpoint",
        "r": "incomplete",
        "s": "quotientval",
        "a": "composite",
        "b": "oddnumber",
        "C": "doubleval"
      },
      "question": "7. Let \\( composite \\) and \\( oddnumber \\) be relatively prime positive integers, \\( oddnumber \\) even. For each positive integer \\( constantval \\) let \\( randomized=randomized(constantval) \\) be chosen so that\n\\[\n\\left|\\frac{randomized}{constantval}-\\frac{composite}{oddnumber}\\right|\n\\]\nis a minimum. Prove that\n\\[\n\\lim _{fractional-\\infty} \\sum_{fixedpoint=1}^{fractional} \\frac{constantval\\left|\\frac{randomized}{constantval}-\\frac{composite}{oddnumber}\\right|}{fractional}=\\frac{1}{4} .\n\\]",
      "solution": "Solution. Rewrite \\( constantval|randomized / constantval-composite / oddnumber| \\) in the form\n\\[\n\\frac{1}{oddnumber}|randomized \\, oddnumber-constantval \\, composite| .\n\\]\n\nFor each \\( constantval \\) we are to choose \\( randomized \\) to minimize this; then \\( randomized \\, oddnumber \\) \\- \\( constantval \\, composite \\) will be the absolutely least residue of \\( constantval \\, composite \\) modulo \\( oddnumber \\). Since \\( composite \\) is relatively prime to \\( oddnumber \\), as \\( constantval \\) varies through a complete set of residues modulo \\( oddnumber \\), so will \\( constantval \\, composite \\), and therefore \\( randomized \\, oddnumber-constantval \\, composite \\) will take the values\n\\[\n-doubleval+1,-doubleval+2, \\ldots-1,0,1, \\ldots, doubleval-1, doubleval\n\\]\nwhere \\( oddnumber=2 \\, doubleval \\) (recall that \\( oddnumber \\) is even) and the contribution to the sum will be\n\\[\n\\begin{aligned}\n\\frac{1}{oddnumber}(0+1+2+\\cdots+ & doubleval-1+doubleval+doubleval-1+\\cdots+1) \\\\\n& =\\frac{doubleval^{2}}{2 \\, doubleval}=oddnumber / 4\n\\end{aligned}\n\\]\n\nThus if \\( fractional=oddnumber \\cdot incomplete+quotientval \\) where \\( 0 \\leq quotientval<oddnumber \\), we have\n\\[\n\\sum_{constantval=1}^{fractional} constantval\\left|\\frac{randomized}{constantval}-\\frac{composite}{oddnumber}\\right|=incomplete \\frac{oddnumber}{4}+\\sum_{constantval=oddnumber \\, incomplete+1}^{oddnumber \\, incomplete+quotientval} constantval\\left|\\frac{randomized}{constantval}-\\frac{composite}{oddnumber}\\right|\n\\]\nsince \\( constantval \\) runs through \\( incomplete \\) complete residue systems \\( (\\bmod oddnumber) \\) and then the integers \\( oddnumber \\, incomplete+1, oddnumber \\, incomplete+2, \\ldots, oddnumber \\, incomplete+quotientval \\). Since \\( randomized(constantval) \\) is the integer nearest to \\( constantval \\, composite / oddnumber \\),\n\\[\nconstantval\\left|\\frac{randomized}{constantval}-\\frac{composite}{oddnumber}\\right|=\\left|randomized-\\frac{constantval \\, composite}{oddnumber}\\right| \\leq \\frac{1}{2}\n\\]\n\nWe have therefore\n\\[\n\\begin{aligned}\n\\left|\\frac{1}{4} \\, fractional-\\sum_{constantval=1}^{fractional} constantval\\right| \\frac{randomized}{constantval}-\\frac{composite}{oddnumber}| | & =\\left|\\frac{quotientval}{4}-\\sum_{constantval=oddnumber \\, incomplete+1}^{oddnumber \\, incomplete+quotientval} constantval\\right| \\frac{randomized}{constantval}-\\frac{composite}{oddnumber}| | . \\\\\n& \\leq \\frac{quotientval}{4}+quotientval \\sup _{constantval} constantval\\left|\\frac{randomized}{constantval}-\\frac{composite}{oddnumber}\\right| \\\\\n& \\leq \\frac{3}{4} \\, quotientval<\\frac{3}{4} \\, oddnumber .\n\\end{aligned}\n\\]\n\nDividing by \\( fractional \\), we get\n\\[\n\\left|\\frac{1}{4}-\\frac{1}{fractional} \\sum_{constantval=1}^{fractional} constantval\\right| \\frac{randomized}{constantval}-\\frac{composite}{oddnumber}| |<\\frac{3 \\, oddnumber}{4 \\, fractional} .\n\\]\n\nLetting \\( fractional \\rightarrow \\infty \\), we see that\n\\[\n\\lim _{fractional \\rightarrow \\infty} \\frac{1}{fractional} \\sum_{constantval=1}^{fractional} constantval\\left|\\frac{randomized}{constantval}-\\frac{composite}{oddnumber}\\right|=\\frac{1}{4} .\n\\]"
    },
    "garbled_string": {
      "map": {
        "q": "xjzfkrla",
        "p": "qzxwvtnp",
        "n": "hjgrksla",
        "y": "fbncqzlo",
        "r": "tmskldpj",
        "s": "vqnhdcej",
        "a": "dzmrfyga",
        "b": "glpksewn",
        "C": "ytrmnbav"
      },
      "question": "7. Let \\( dzmrfyga \\) and \\( glpksewn \\) be relatively prime positive integers, \\( glpksewn \\) even. For each positive integer \\( xjzfkrla \\) let \\( qzxwvtnp=qzxwvtnp(xjzfkrla) \\) be chosen so that\n\\[\n\\left|\\frac{qzxwvtnp}{xjzfkrla}-\\frac{dzmrfyga}{glpksewn}\\right|\n\\]\nis a minimum. Prove that\n\\[\n\\lim _{hjgrksla-\\infty} \\sum_{fbncqzlo=1}^{hjgrksla} \\frac{xjzfkrla\\left|\\frac{qzxwvtnp}{xjzfkrla}-\\frac{dzmrfyga}{glpksewn}\\right|}{hjgrksla}=\\frac{1}{4} .\n\\]",
      "solution": "Solution. Rewrite \\( xjzfkrla|qzxwvtnp / xjzfkrla-dzmrfyga / glpksewn| \\) in the form\n\\[\n\\frac{1}{glpksewn}|qzxwvtnp glpksewn-xjzfkrla dzmrfyga| .\n\\]\n\nFor each \\( xjzfkrla \\) we are to choose \\( qzxwvtnp \\) to minimize this; then \\( qzxwvtnp glpksewn \\) - \\( xjzfkrla dzmrfyga \\) will be the absolutely least residue of \\( xjzfkrla dzmrfyga \\) modulo \\( glpksewn \\). Since \\( dzmrfyga \\) is relatively prime to \\( glpksewn \\), as \\( xjzfkrla \\) varies through a complete set of residues modulo \\( glpksewn \\), so will \\( xjzfkrla dzmrfyga \\), and therefore \\( qzxwvtnp glpksewn-xjzfkrla dzmrfyga \\) will take the values\n\\[\n-ytrmnbav+1,-ytrmnbav+2, \\ldots-1,0,1, \\ldots, ytrmnbav-1, ytrmnbav\n\\]\nwhere \\( glpksewn=2 ytrmnbav \\) (recall that \\( glpksewn \\) is even) and the contribution to the sum will be\n\\[\n\\begin{aligned}\n\\frac{1}{glpksewn}(0+1+2+\\cdots+ & ytrmnbav-1+ytrmnbav+ytrmnbav-1+\\cdots+1) \\\\\n& =\\frac{ytrmnbav^{2}}{2 ytrmnbav}=glpksewn / 4\n\\end{aligned}\n\\]\n\nThus if \\( hjgrksla=glpksewn \\cdot tmskldpj+vqnhdcej \\) where \\( 0 \\leq vqnhdcej<glpksewn \\), we have\n\\[\n\\sum_{xjzfkrla=1}^{hjgrksla} xjzfkrla\\left|\\frac{qzxwvtnp}{xjzfkrla}-\\frac{dzmrfyga}{glpksewn}\\right|=tmskldpj \\frac{glpksewn}{4}+\\sum_{xjzfkrla=glpksewn tmskldpj+1}^{glpksewn tmskldpj+vqnhdcej} xjzfkrla\\left|\\frac{qzxwvtnp}{xjzfkrla}-\\frac{dzmrfyga}{glpksewn}\\right|\n\\]\nsince \\( xjzfkrla \\) runs through \\( tmskldpj \\) complete residue systems \\( (\\bmod glpksewn) \\) and then the integers \\( glpksewn tmskldpj+1, glpksewn tmskldpj+2, \\ldots, glpksewn tmskldpj+vqnhdcej \\). Since \\( qzxwvtnp(xjzfkrla) \\) is the integer nearest to \\( xjzfkrla dzmrfyga / glpksewn \\),\n\\[\nxjzfkrla\\left|\\frac{qzxwvtnp}{xjzfkrla}-\\frac{dzmrfyga}{glpksewn}\\right|=\\left|qzxwvtnp-\\frac{xjzfkrla dzmrfyga}{glpksewn}\\right| \\leq \\frac{1}{2}\n\\]\n\nWe have therefore\n\\[\n\\begin{aligned}\n\\left|\\frac{1}{4} hjgrksla-\\sum_{xjzfkrla=1}^{hjgrksla} xjzfkrla\\right| \\frac{qzxwvtnp}{xjzfkrla}-\\frac{dzmrfyga}{glpksewn}| | & =\\left|\\frac{vqnhdcej}{4}-\\sum_{xjzfkrla=glpksewn tmskldpj+1}^{glpksewn tmskldpj+vqnhdcej} xjzfkrla\\right| \\frac{qzxwvtnp}{xjzfkrla}-\\frac{dzmrfyga}{glpksewn}| | . \\\\\n& \\leq \\frac{vqnhdcej}{4}+vqnhdcej \\sup _{xjzfkrla} xjzfkrla\\left|\\frac{qzxwvtnp}{xjzfkrla}-\\frac{dzmrfyga}{glpksewn}\\right| \\\\\n& \\leq \\frac{3}{4} vqnhdcej<\\frac{3}{4} glpksewn .\n\\end{aligned}\n\\]\n\nDividing by \\( hjgrksla \\), we get\n\\[\n\\left|\\frac{1}{4}-\\frac{1}{hjgrksla} \\sum_{xjzfkrla=1}^{hjgrksla} xjzfkrla\\right| \\frac{qzxwvtnp}{xjzfkrla}-\\frac{dzmrfyga}{glpksewn}| |<\\frac{3 glpksewn}{4 hjgrksla} .\n\\]\n\nLetting \\( hjgrksla \\rightarrow \\infty \\), we see that\n\\[\n\\lim _{hjgrksla \\rightarrow \\infty} \\frac{1}{hjgrksla} \\sum_{xjzfkrla=1}^{hjgrksla} xjzfkrla\\left|\\frac{qzxwvtnp}{xjzfkrla}-\\frac{dzmrfyga}{glpksewn}\\right|=\\frac{1}{4} .\n\\]"
    },
    "kernel_variant": {
      "question": "Fix an integer d ≥ 2.  \nLet  \n\n  (a₁,b₁), … , (a_d ,b_d) ∈ ℕ²  \n\nbe d ordered pairs such that  \n1. gcd(a_i , b_i ) = 1 for every i,  \n2. every b_i is odd, and  \n3. the denominators are pair-wise coprime: gcd(b_i , b_j ) = 1 whenever i ≠ j.\n\nFor every integer q ≥ 1 choose the integer vector  \n\n  p(q) = (p₁(q), … , p_d(q)) ∈ ℤᵈ  \n\nby the “nearest–integer” rule  \n\n  p_i(q) is the (unique) integer that minimises  \n  | p / q – a_i / b_i |.  \nIf two integers are at the same distance we agree to take the larger one; this tie–breaking convention will never be needed except when b_i divides q a_i /2 and guarantees that p_i(q) is a well–defined function of q.\n\nFor every q define  \n\n  F(q) = q^{\\,d}\\;∏_{i=1}^{d} | p_i(q)/q – a_i/b_i |.\n\nPut  \n\n  B = lcm(b₁,…,b_d) = b₁·…·b_d                         (because the b_i are pair-wise coprime).\n\nProve that the Cesàro mean of F taken over any block of n consecutive integers that starts immediately after a complete B–cycle converges, namely  \n\n  lim_{n→∞}  1/(n+1) ∑_{q=B+1}^{B+n} F(q)  =  ∏_{i=1}^{d} (b_i² − 1)/(4 b_i²).\n\nThus, no matter how large a block one takes, as long as it begins with B + 1 its average value stabilises to the constant on the right.",
      "solution": "Throughout we write  \n\n  δ_i(q) = | p_i(q) b_i − q a_i |            (0 ≤ δ_i(q) ≤ (b_i−1)/2).   (1)\n\nBecause p_i(q) is chosen by the nearest–integer rule, δ_i(q) is the absolutely least residue of q a_i modulo b_i.\n\nStep 1.  Re-express F(q).  \nFrom (1) we have\n\n  | p_i(q)/q − a_i/b_i | = δ_i(q)/(q b_i),\n\nwhence\n\n  F(q) = q^{d} ∏_{i=1}^{d} δ_i(q)/(q b_i)  \n        = ∏_{i=1}^{d} δ_i(q)/b_i.                                  (2)\n\nConsequently F depends only on the residues of q modulo the b_i and is therefore B-periodic:\n\n  F(q+B) = F(q) for every q.                                       (3)\n\nStep 2.  The distribution of the residue vector.  \nThe Chinese Remainder Theorem gives a bijection\n\n  q (mod B) ↦ ( q a₁ (mod b₁), …, q a_d (mod b_d) )\n\nfrom ℤ/Bℤ onto the product ∏ ℤ/b_iℤ.  Hence, as q runs through any complete set of B consecutive integers, the ordinary residue vector\n\n  r(q) = ( r₁(q), …, r_d(q) ) with r_i(q) ≡ q a_i (mod b_i)\n\nis uniformly distributed on that product and its coordinates are independent.\n\nPassing from r_i(q) to the absolute residues δ_i(q) is deterministic: for each i\n\n  δ_i(q) = min{ r_i(q), b_i − r_i(q) }.\n\nBecause exactly two ordinary residues reduce to the same positive absolute residue ±r (1 ≤ r ≤ (b_i−1)/2) and only one residue reduces to 0, we get the precise distribution  \n\n  P[ δ_i(q)=0 ] = 1/b_i ,    \n  P[ δ_i(q)=r ] = 2/b_i    (1≤r≤(b_i−1)/2).                      (4)\n\nIndependence of the coordinates survives this projection, so the random variables (δ₁(q), …, δ_d(q)) are still independent.\n\nStep 3.  Expectation of one coordinate.  \nWrite b_i = 2C_i + 1.  Using (4)\n\n  E[ δ_i ] = (1/b_i)·0 + (2/b_i)·(1 + 2 + … + C_i)  \n          = (2/b_i)·C_i(C_i+1)/2  \n          = ( b_i² − 1 )/(4 b_i).                                  (5)\n\nStep 4.  Expectation of the product.  \nBecause the δ_i are independent,\n\n  E[ ∏_{i=1}^{d} δ_i ] = ∏_{i=1}^{d} E[ δ_i ]  \n                      = ∏_{i=1}^{d} ( b_i² − 1 )/(4 b_i).          (6)\n\nStep 5.  Mean value over one complete B-block.  \nCombining (2) and (6),\n\n  (1/B) ∑_{q=1}^{B} F(q) = ∏_{i=1}^{d} ( b_i² − 1 )/(4 b_i²).    (7)\n\nStep 6.  Cesàro mean over an arbitrary long block post-B.  \nBecause of the periodicity (3),\n\n  ∑_{q=B+1}^{B+n} F(q) = ∑_{q=1}^{n} F(q).                        (8)\n\nWrite n = K B + r with 0 ≤ r < B.  Split the sum in (8) into the first K complete periods plus a tail of length r:\n\n  ∑_{q=1}^{n} F(q)  \n  = K ∑_{q=1}^{B} F(q) + ∑_{q=KB+1}^{KB+r} F(q).                  (9)\n\nThe first term equals K B·∏_{i}(b_i² − 1)/(4 b_i²) by (7).\nFor the tail we use |δ_i(q)| ≤ (b_i−1)/2, so, from (2),\n\n  0 ≤ F(q) ≤ ∏_{i=1}^{d} (b_i−1)/(2 b_i) ≔ M.                   (10)\n\nTherefore the tail is < M B  (because r < B).  Putting everything together and dividing by n+1 = K B + r + 1,\n\n  |  (1/(n+1)) ∑_{q=B+1}^{B+n} F(q) − ∏_{i}(b_i²−1)/(4 b_i²) |\n      ≤  (M B + ∏_{i}(b_i²−1)/(4 b_i²)·(B−1)) / (n+1)            (11)\n\nwhich is O(1/(n+1)).  Letting n → ∞ forces the right-hand side to 0, yielding\n\n  lim_{n→∞}  1/(n+1) ∑_{q=B+1}^{B+n} F(q) = ∏_{i=1}^{d} (b_i² − 1)/(4 b_i²). □",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T19:09:31.496311",
        "was_fixed": false,
        "difficulty_analysis": "1.  Higher dimension: the problem moves from a single rational approximation to simultaneous approximation in $d$ dimensions, introducing the necessity of analysing joint residue behaviour.\n\n2.  Additional variables and coprimality conditions: one must track an arbitrary number of denominators $b_{1},\\dots ,b_{d}$, prove pairwise independence, and manage the least-residue calculation in each coordinate.\n\n3.  Deeper theoretical tools: the solution relies on the Chinese Remainder Theorem to establish *uniform distribution* and *statistical independence* of a multidimensional residue vector, concepts absent from the original problem.\n\n4.  More sophisticated averaging: the summand now involves a product of $d$ small differences and a factor $q^{d}$, so cancellations that were automatic in one dimension must be proved via expectation factorisation.\n\n5.  Error control in incomplete cycles: bounding the tail for *all* $d$ simultaneously requires sharper uniform bounds than the scalar case.\n\n6.  Conceptual load: the solver must blend elementary number theory (least residues, CRT) with probabilistic language (expectations, independence) and asymptotic analysis, making the variant substantially more intricate and multi-layered than either the original or the existing kernel version."
      }
    },
    "original_kernel_variant": {
      "question": "Fix an integer d ≥ 2.  \nLet  \n\n  (a₁,b₁), … , (a_d ,b_d) ∈ ℕ²  \n\nbe d ordered pairs such that  \n1. gcd(a_i , b_i ) = 1 for every i,  \n2. every b_i is odd, and  \n3. the denominators are pair-wise coprime: gcd(b_i , b_j ) = 1 whenever i ≠ j.\n\nFor every integer q ≥ 1 choose the integer vector  \n\n  p(q) = (p₁(q), … , p_d(q)) ∈ ℤᵈ  \n\nby the “nearest–integer” rule  \n\n  p_i(q) is the (unique) integer that minimises  \n  | p / q – a_i / b_i |.  \nIf two integers are at the same distance we agree to take the larger one; this tie–breaking convention will never be needed except when b_i divides q a_i /2 and guarantees that p_i(q) is a well–defined function of q.\n\nFor every q define  \n\n  F(q) = q^{\\,d}\\;∏_{i=1}^{d} | p_i(q)/q – a_i/b_i |.\n\nPut  \n\n  B = lcm(b₁,…,b_d) = b₁·…·b_d                         (because the b_i are pair-wise coprime).\n\nProve that the Cesàro mean of F taken over any block of n consecutive integers that starts immediately after a complete B–cycle converges, namely  \n\n  lim_{n→∞}  1/(n+1) ∑_{q=B+1}^{B+n} F(q)  =  ∏_{i=1}^{d} (b_i² − 1)/(4 b_i²).\n\nThus, no matter how large a block one takes, as long as it begins with B + 1 its average value stabilises to the constant on the right.",
      "solution": "Throughout we write  \n\n  δ_i(q) = | p_i(q) b_i − q a_i |            (0 ≤ δ_i(q) ≤ (b_i−1)/2).   (1)\n\nBecause p_i(q) is chosen by the nearest–integer rule, δ_i(q) is the absolutely least residue of q a_i modulo b_i.\n\nStep 1.  Re-express F(q).  \nFrom (1) we have\n\n  | p_i(q)/q − a_i/b_i | = δ_i(q)/(q b_i),\n\nwhence\n\n  F(q) = q^{d} ∏_{i=1}^{d} δ_i(q)/(q b_i)  \n        = ∏_{i=1}^{d} δ_i(q)/b_i.                                  (2)\n\nConsequently F depends only on the residues of q modulo the b_i and is therefore B-periodic:\n\n  F(q+B) = F(q) for every q.                                       (3)\n\nStep 2.  The distribution of the residue vector.  \nThe Chinese Remainder Theorem gives a bijection\n\n  q (mod B) ↦ ( q a₁ (mod b₁), …, q a_d (mod b_d) )\n\nfrom ℤ/Bℤ onto the product ∏ ℤ/b_iℤ.  Hence, as q runs through any complete set of B consecutive integers, the ordinary residue vector\n\n  r(q) = ( r₁(q), …, r_d(q) ) with r_i(q) ≡ q a_i (mod b_i)\n\nis uniformly distributed on that product and its coordinates are independent.\n\nPassing from r_i(q) to the absolute residues δ_i(q) is deterministic: for each i\n\n  δ_i(q) = min{ r_i(q), b_i − r_i(q) }.\n\nBecause exactly two ordinary residues reduce to the same positive absolute residue ±r (1 ≤ r ≤ (b_i−1)/2) and only one residue reduces to 0, we get the precise distribution  \n\n  P[ δ_i(q)=0 ] = 1/b_i ,    \n  P[ δ_i(q)=r ] = 2/b_i    (1≤r≤(b_i−1)/2).                      (4)\n\nIndependence of the coordinates survives this projection, so the random variables (δ₁(q), …, δ_d(q)) are still independent.\n\nStep 3.  Expectation of one coordinate.  \nWrite b_i = 2C_i + 1.  Using (4)\n\n  E[ δ_i ] = (1/b_i)·0 + (2/b_i)·(1 + 2 + … + C_i)  \n          = (2/b_i)·C_i(C_i+1)/2  \n          = ( b_i² − 1 )/(4 b_i).                                  (5)\n\nStep 4.  Expectation of the product.  \nBecause the δ_i are independent,\n\n  E[ ∏_{i=1}^{d} δ_i ] = ∏_{i=1}^{d} E[ δ_i ]  \n                      = ∏_{i=1}^{d} ( b_i² − 1 )/(4 b_i).          (6)\n\nStep 5.  Mean value over one complete B-block.  \nCombining (2) and (6),\n\n  (1/B) ∑_{q=1}^{B} F(q) = ∏_{i=1}^{d} ( b_i² − 1 )/(4 b_i²).    (7)\n\nStep 6.  Cesàro mean over an arbitrary long block post-B.  \nBecause of the periodicity (3),\n\n  ∑_{q=B+1}^{B+n} F(q) = ∑_{q=1}^{n} F(q).                        (8)\n\nWrite n = K B + r with 0 ≤ r < B.  Split the sum in (8) into the first K complete periods plus a tail of length r:\n\n  ∑_{q=1}^{n} F(q)  \n  = K ∑_{q=1}^{B} F(q) + ∑_{q=KB+1}^{KB+r} F(q).                  (9)\n\nThe first term equals K B·∏_{i}(b_i² − 1)/(4 b_i²) by (7).\nFor the tail we use |δ_i(q)| ≤ (b_i−1)/2, so, from (2),\n\n  0 ≤ F(q) ≤ ∏_{i=1}^{d} (b_i−1)/(2 b_i) ≔ M.                   (10)\n\nTherefore the tail is < M B  (because r < B).  Putting everything together and dividing by n+1 = K B + r + 1,\n\n  |  (1/(n+1)) ∑_{q=B+1}^{B+n} F(q) − ∏_{i}(b_i²−1)/(4 b_i²) |\n      ≤  (M B + ∏_{i}(b_i²−1)/(4 b_i²)·(B−1)) / (n+1)            (11)\n\nwhich is O(1/(n+1)).  Letting n → ∞ forces the right-hand side to 0, yielding\n\n  lim_{n→∞}  1/(n+1) ∑_{q=B+1}^{B+n} F(q) = ∏_{i=1}^{d} (b_i² − 1)/(4 b_i²). □",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T01:37:45.415344",
        "was_fixed": false,
        "difficulty_analysis": "1.  Higher dimension: the problem moves from a single rational approximation to simultaneous approximation in $d$ dimensions, introducing the necessity of analysing joint residue behaviour.\n\n2.  Additional variables and coprimality conditions: one must track an arbitrary number of denominators $b_{1},\\dots ,b_{d}$, prove pairwise independence, and manage the least-residue calculation in each coordinate.\n\n3.  Deeper theoretical tools: the solution relies on the Chinese Remainder Theorem to establish *uniform distribution* and *statistical independence* of a multidimensional residue vector, concepts absent from the original problem.\n\n4.  More sophisticated averaging: the summand now involves a product of $d$ small differences and a factor $q^{d}$, so cancellations that were automatic in one dimension must be proved via expectation factorisation.\n\n5.  Error control in incomplete cycles: bounding the tail for *all* $d$ simultaneously requires sharper uniform bounds than the scalar case.\n\n6.  Conceptual load: the solver must blend elementary number theory (least residues, CRT) with probabilistic language (expectations, independence) and asymptotic analysis, making the variant substantially more intricate and multi-layered than either the original or the existing kernel version."
      }
    }
  },
  "checked": true,
  "problem_type": "proof"
}