{
  "index": "1982-B-3",
  "type": "NT",
  "tag": [
    "NT",
    "COMB"
  ],
  "difficulty": "",
  "question": "Problem B-3\nLet \\( p_{n} \\) be the probability that \\( c+d \\) is a perfect square when the integers \\( c \\) and \\( d \\) are selected independently at random from the set \\( \\{1,2,3, \\ldots, n\\} \\). Show that \\( \\lim _{n \\rightarrow \\infty}\\left(p_{n} \\sqrt{n}\\right) \\) exists and express this limit in the form \\( r(\\sqrt{s}-1) \\). where \\( s \\) and \\( t \\) are integers and \\( r \\) is a rational number.",
  "solution": "B-3.\nLet \\( a(n)=[\\sqrt{n+1}] \\) and \\( b(n)=[\\sqrt{2 n}] \\), where \\( [x] \\) is the greatest integer in \\( x \\). For \\( t \\) in \\( \\{1,2, \\ldots, a(n)\\} \\), there are \\( t^{2}-1 \\) ordered pairs \\( (c, d) \\) with \\( c \\) and \\( d \\) in \\( X=\\{1,2, \\ldots, n\\} \\) and \\( c+d=t^{2} \\). For \\( t \\) in \\( \\{1+a(n), 2+a(n), \\ldots, b(n)\\} \\), there are \\( 2 n+1-t^{2} \\) ordered pairs \\( (c, d) \\) with \\( c \\) and \\( d \\) in \\( X \\) and \\( c+d=t^{2} \\). Hence the total number \\( F(n) \\) of favorable \\( (c, d) \\) is\n\\[\n\\begin{aligned}\nF(n)= & \\sum_{t=1}^{a(n)}\\left(t^{2}-1\\right)+\\sum_{t=1+a(n)}^{b(n)}\\left(2 n+1-t^{2}\\right) \\\\\n= & \\left(2 \\sum_{t=1}^{a(n)} t^{2}\\right)-\\left(\\sum_{t=1}^{b(n)} t^{2}\\right)-a(n)+[b(n)-a(n)](2 n+1) \\\\\n= & \\frac{2 a(n)[1+a(n)][1+2 a(n)]}{6}-\\frac{b(n)[1+b(n)][1+2 b(n)]}{6} \\\\\n& -2(n+1) a(n)+(2 n+1) b(n) .\n\\end{aligned}\n\\]\n\nSince \\( p_{n}=F(n) / n^{2} \\),\n\\[\n\\begin{aligned}\n\\lim _{n \\rightarrow \\infty}\\left(p_{n} \\sqrt{n}\\right) & =\\lim _{n \\rightarrow \\infty} F(n) / n^{3 / 2} \\\\\n& =\\frac{2 \\cdot 2}{6} \\lim _{n \\rightarrow \\infty}\\left(\\frac{a(n)}{\\sqrt{n}}\\right)^{3}-\\frac{2}{6} \\lim _{n \\rightarrow \\infty}\\left(\\frac{b(n)}{\\sqrt{n}}\\right)^{3}-2 \\lim _{n \\rightarrow \\infty} \\frac{a(n)}{\\sqrt{n}}+2 \\lim _{n \\rightarrow \\infty} \\frac{b(n)}{\\sqrt{n}} \\\\\n& =\\frac{2}{3}-\\frac{1}{3}(\\sqrt{2})^{3}-2+2 \\sqrt{2}=\\frac{4}{3}(\\sqrt{2}-1)\n\\end{aligned}\n\\]",
  "vars": [
    "p_n",
    "c",
    "d",
    "n",
    "t",
    "a",
    "b",
    "F",
    "X"
  ],
  "params": [
    "r",
    "s"
  ],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "p_n": "squareprob",
        "c": "firstint",
        "d": "secondint",
        "n": "maxvalue",
        "t": "rootsize",
        "a": "firstfloor",
        "b": "secondfloor",
        "F": "totalfav",
        "X": "integerset",
        "r": "ratioscale",
        "s": "basesquare"
      },
      "question": "Problem B-3\nLet \\( squareprob \\) be the probability that \\( firstint+secondint \\) is a perfect square when the integers \\( firstint \\) and \\( secondint \\) are selected independently at random from the set \\( \\{1,2,3, \\ldots, maxvalue\\} \\). Show that \\( \\lim _{maxvalue \\rightarrow \\infty}\\left(squareprob \\sqrt{maxvalue}\\right) \\) exists and express this limit in the form \\( ratioscale(\\sqrt{basesquare}-1) \\). where \\( basesquare \\) and \\( rootsize \\) are integers and \\( ratioscale \\) is a rational number.",
      "solution": "B-3.\nLet \\( firstfloor(maxvalue)=[\\sqrt{maxvalue+1}] \\) and \\( secondfloor(maxvalue)=[\\sqrt{2\\, maxvalue}] \\), where \\( [x] \\) is the greatest integer in \\( x \\). For \\( rootsize \\) in \\( \\{1,2, \\ldots, firstfloor(maxvalue)\\} \\), there are \\( rootsize^{2}-1 \\) ordered pairs \\( (firstint, secondint) \\) with \\( firstint \\) and \\( secondint \\) in \\( integerset=\\{1,2, \\ldots, maxvalue\\} \\) and \\( firstint+secondint=rootsize^{2} \\). For \\( rootsize \\) in \\( \\{1+firstfloor(maxvalue), 2+firstfloor(maxvalue), \\ldots, secondfloor(maxvalue)\\} \\), there are \\( 2\\, maxvalue+1-rootsize^{2} \\) ordered pairs \\( (firstint, secondint) \\) with \\( firstint \\) and \\( secondint \\) in \\( integerset \\) and \\( firstint+secondint=rootsize^{2} \\). Hence the total number \\( totalfav(maxvalue) \\) of favorable \\( (firstint, secondint) \\) is\n\\[\n\\begin{aligned}\ntotalfav(maxvalue)= & \\sum_{rootsize=1}^{firstfloor(maxvalue)}\\left(rootsize^{2}-1\\right)+\\sum_{rootsize=1+firstfloor(maxvalue)}^{secondfloor(maxvalue)}\\left(2\\, maxvalue+1-rootsize^{2}\\right) \\\\\n= & \\left(2 \\sum_{rootsize=1}^{firstfloor(maxvalue)} rootsize^{2}\\right)-\\left(\\sum_{rootsize=1}^{secondfloor(maxvalue)} rootsize^{2}\\right)-firstfloor(maxvalue)+[secondfloor(maxvalue)-firstfloor(maxvalue)](2\\, maxvalue+1) \\\\\n= & \\frac{2\\, firstfloor(maxvalue)[1+firstfloor(maxvalue)][1+2\\, firstfloor(maxvalue)]}{6}-\\frac{secondfloor(maxvalue)[1+secondfloor(maxvalue)][1+2\\, secondfloor(maxvalue)]}{6} \\\\\n& -2(maxvalue+1)\\, firstfloor(maxvalue)+(2\\, maxvalue+1)\\, secondfloor(maxvalue) .\n\\end{aligned}\n\\]\n\nSince \\( squareprob=totalfav(maxvalue) / maxvalue^{2} \\),\n\\[\n\\begin{aligned}\n\\lim _{maxvalue \\rightarrow \\infty}\\left(squareprob \\sqrt{maxvalue}\\right) & =\\lim _{maxvalue \\rightarrow \\infty} \\frac{totalfav(maxvalue)}{maxvalue^{3 / 2}} \\\\\n& =\\frac{2 \\cdot 2}{6} \\lim _{maxvalue \\rightarrow \\infty}\\left(\\frac{firstfloor(maxvalue)}{\\sqrt{maxvalue}}\\right)^{3}-\\frac{2}{6} \\lim _{maxvalue \\rightarrow \\infty}\\left(\\frac{secondfloor(maxvalue)}{\\sqrt{maxvalue}}\\right)^{3}-2 \\lim _{maxvalue \\rightarrow \\infty} \\frac{firstfloor(maxvalue)}{\\sqrt{maxvalue}}+2 \\lim _{maxvalue \\rightarrow \\infty} \\frac{secondfloor(maxvalue)}{\\sqrt{maxvalue}} \\\\\n& =\\frac{2}{3}-\\frac{1}{3}(\\sqrt{2})^{3}-2+2 \\sqrt{2}=\\frac{4}{3}(\\sqrt{2}-1)\n\\end{aligned}\n\\]\n"
    },
    "descriptive_long_confusing": {
      "map": {
        "p_n": "gastronom",
        "c": "lanterns",
        "d": "notebook",
        "n": "snowflake",
        "t": "buttercup",
        "a": "pendulum",
        "b": "marigold",
        "F": "harmonica",
        "X": "silhouette",
        "r": "tangerine",
        "s": "waterfall"
      },
      "question": "Problem B-3\nLet \\( gastronom_{snowflake} \\) be the probability that \\( lanterns+notebook \\) is a perfect square when the integers \\( lanterns \\) and \\( notebook \\) are selected independently at random from the set \\{1,2,3, \\ldots, snowflake\\}. Show that \\( \\lim _{snowflake \\rightarrow \\infty}\\left(gastronom_{snowflake} \\sqrt{snowflake}\\right) \\) exists and express this limit in the form \\( tangerine(\\sqrt{waterfall}-1) \\). where \\( waterfall \\) and \\( buttercup \\) are integers and \\( tangerine \\) is a rational number.",
      "solution": "B-3.\nLet \\( pendulum(snowflake)=[\\sqrt{snowflake+1}] \\) and \\( marigold(snowflake)=[\\sqrt{2 snowflake}] \\), where \\( [x] \\) is the greatest integer in \\( x \\). For \\( buttercup \\) in \\{1,2, \\ldots, pendulum(snowflake)\\}, there are \\( buttercup^{2}-1 \\) ordered pairs \\( (lanterns, notebook) \\) with \\( lanterns \\) and \\( notebook \\) in \\( silhouette=\\{1,2, \\ldots, snowflake\\} \\) and \\( lanterns+notebook=buttercup^{2} \\). For \\( buttercup \\) in \\{1+pendulum(snowflake), 2+pendulum(snowflake), \\ldots, marigold(snowflake)\\}, there are \\( 2 snowflake+1-buttercup^{2} \\) ordered pairs \\( (lanterns, notebook) \\) with \\( lanterns \\) and \\( notebook \\) in \\( silhouette \\) and \\( lanterns+notebook=buttercup^{2} \\). Hence the total number \\( harmonica(snowflake) \\) of favorable \\( (lanterns, notebook) \\) is\n\\[\n\\begin{aligned}\nharmonica(snowflake)= & \\sum_{buttercup=1}^{pendulum(snowflake)}\\left(buttercup^{2}-1\\right)+\\sum_{buttercup=1+pendulum(snowflake)}^{marigold(snowflake)}\\left(2 snowflake+1-buttercup^{2}\\right) \\\\\n= & \\left(2 \\sum_{buttercup=1}^{pendulum(snowflake)} buttercup^{2}\\right)-\\left(\\sum_{buttercup=1}^{marigold(snowflake)} buttercup^{2}\\right)-pendulum(snowflake)+[marigold(snowflake)-pendulum(snowflake)](2 snowflake+1) \\\\\n= & \\frac{2 pendulum(snowflake)[1+pendulum(snowflake)][1+2 pendulum(snowflake)]}{6}-\\frac{marigold(snowflake)[1+marigold(snowflake)][1+2 marigold(snowflake)]}{6} \\\\\n& -2(snowflake+1) pendulum(snowflake)+(2 snowflake+1) marigold(snowflake) .\n\\end{aligned}\n\\]\n\nSince \\( gastronom_{snowflake}=harmonica(snowflake) / snowflake^{2} \\),\n\\[\n\\begin{aligned}\n\\lim _{snowflake \\rightarrow \\infty}\\left(gastronom_{snowflake} \\sqrt{snowflake}\\right) & =\\lim _{snowflake \\rightarrow \\infty} harmonica(snowflake) / snowflake^{3 / 2} \\\\\n& =\\frac{2 \\cdot 2}{6} \\lim _{snowflake \\rightarrow \\infty}\\left(\\frac{pendulum(snowflake)}{\\sqrt{snowflake}}\\right)^{3}-\\frac{2}{6} \\lim _{snowflake \\rightarrow \\infty}\\left(\\frac{marigold(snowflake)}{\\sqrt{snowflake}}\\right)^{3}-2 \\lim _{snowflake \\rightarrow \\infty} \\frac{pendulum(snowflake)}{\\sqrt{snowflake}}+2 \\lim _{snowflake \\rightarrow \\infty} \\frac{marigold(snowflake)}{\\sqrt{snowflake}} \\\\\n& =\\frac{2}{3}-\\frac{1}{3}(\\sqrt{2})^{3}-2+2 \\sqrt{2}=\\frac{4}{3}(\\sqrt{2}-1)\n\\end{aligned}\n\\]"
    },
    "descriptive_long_misleading": {
      "map": {
        "p_n": "improbability",
        "c": "floatvalue",
        "d": "fractionalvalue",
        "n": "unlimitedsize",
        "t": "stillnessvalue",
        "a": "cubicmeasure",
        "b": "apexmeasure",
        "F": "unfavorablecount",
        "X": "complementset",
        "r": "irrationalnum",
        "s": "nonsquarevalue"
      },
      "question": "Problem B-3\nLet \\( improbability \\) be the probability that \\( floatvalue+fractionalvalue \\) is a perfect square when the integers \\( floatvalue \\) and \\( fractionalvalue \\) are selected independently at random from the set \\( \\{1,2,3, \\ldots, unlimitedsize\\} \\). Show that \\( \\lim _{unlimitedsize \\rightarrow \\infty}\\left(improbability \\sqrt{unlimitedsize}\\right) \\) exists and express this limit in the form \\( irrationalnum(\\sqrt{nonsquarevalue}-1) \\). where \\( nonsquarevalue \\) and \\( stillnessvalue \\) are integers and \\( irrationalnum \\) is a rational number.",
      "solution": "B-3.\nLet \\( cubicmeasure(unlimitedsize)=[\\sqrt{unlimitedsize+1}] \\) and \\( apexmeasure(unlimitedsize)=[\\sqrt{2 unlimitedsize}] \\), where \\( [x] \\) is the greatest integer in \\( x \\). For \\( stillnessvalue \\) in \\( \\{1,2, \\ldots, cubicmeasure(unlimitedsize)\\} \\), there are \\( stillnessvalue^{2}-1 \\) ordered pairs \\( (floatvalue, fractionalvalue) \\) with \\( floatvalue \\) and \\( fractionalvalue \\) in \\( complementset=\\{1,2, \\ldots, unlimitedsize\\} \\) and \\( floatvalue+fractionalvalue=stillnessvalue^{2} \\). For \\( stillnessvalue \\) in \\( \\{1+cubicmeasure(unlimitedsize), 2+cubicmeasure(unlimitedsize), \\ldots, apexmeasure(unlimitedsize)\\} \\), there are \\( 2 unlimitedsize+1-stillnessvalue^{2} \\) ordered pairs \\( (floatvalue, fractionalvalue) \\) with \\( floatvalue \\) and \\( fractionalvalue \\) in \\( complementset \\) and \\( floatvalue+fractionalvalue=stillnessvalue^{2} \\). Hence the total number \\( unfavorablecount(unlimitedsize) \\) of favorable \\( (floatvalue, fractionalvalue) \\) is\n\\[\n\\begin{aligned}\nunfavorablecount(unlimitedsize)= & \\sum_{stillnessvalue=1}^{cubicmeasure(unlimitedsize)}\\left(stillnessvalue^{2}-1\\right)+\\sum_{stillnessvalue=1+cubicmeasure(unlimitedsize)}^{apexmeasure(unlimitedsize)}\\left(2 unlimitedsize+1-stillnessvalue^{2}\\right) \\\\\n= & \\left(2 \\sum_{stillnessvalue=1}^{cubicmeasure(unlimitedsize)} stillnessvalue^{2}\\right)-\\left(\\sum_{stillnessvalue=1}^{apexmeasure(unlimitedsize)} stillnessvalue^{2}\\right)-cubicmeasure(unlimitedsize)+[apexmeasure(unlimitedsize)-cubicmeasure(unlimitedsize)](2 unlimitedsize+1) \\\\\n= & \\frac{2 cubicmeasure(unlimitedsize)[1+cubicmeasure(unlimitedsize)][1+2 cubicmeasure(unlimitedsize)]}{6}-\\frac{apexmeasure(unlimitedsize)[1+apexmeasure(unlimitedsize)][1+2 apexmeasure(unlimitedsize)]}{6} \\\\\n& -2(unlimitedsize+1) cubicmeasure(unlimitedsize)+(2 unlimitedsize+1) apexmeasure(unlimitedsize) .\n\\end{aligned}\n\\]\n\nSince \\( improbability=unfavorablecount(unlimitedsize) / unlimitedsize^{2} \\),\n\\[\n\\begin{aligned}\n\\lim _{unlimitedsize \\rightarrow \\infty}\\left(improbability \\sqrt{unlimitedsize}\\right) & =\\lim _{unlimitedsize \\rightarrow \\infty} unfavorablecount(unlimitedsize) / unlimitedsize^{3 / 2} \\\\\n& =\\frac{2 \\cdot 2}{6} \\lim _{unlimitedsize \\rightarrow \\infty}\\left(\\frac{cubicmeasure(unlimitedsize)}{\\sqrt{unlimitedsize}}\\right)^{3}-\\frac{2}{6} \\lim _{unlimitedsize \\rightarrow \\infty}\\left(\\frac{apexmeasure(unlimitedsize)}{\\sqrt{unlimitedsize}}\\right)^{3}-2 \\lim _{unlimitedsize \\rightarrow \\infty} \\frac{cubicmeasure(unlimitedsize)}{\\sqrt{unlimitedsize}}+2 \\lim _{unlimitedsize \\rightarrow \\infty} \\frac{apexmeasure(unlimitedsize)}{\\sqrt{unlimitedsize}} \\\\\n& =\\frac{2}{3}-\\frac{1}{3}(\\sqrt{2})^{3}-2+2 \\sqrt{2}=\\frac{4}{3}(\\sqrt{2}-1)\n\\end{aligned}\n\\]\n"
    },
    "garbled_string": {
      "map": {
        "p_n": "qzxwvtnp",
        "c": "hjgrksla",
        "d": "mnlpqrst",
        "n": "gnbshplt",
        "t": "vrwzcpky",
        "a": "slqzmhvd",
        "b": "kjptwqxr",
        "F": "wldjskrp",
        "X": "zbfruoyg",
        "r": "xckptfma",
        "s": "qrlgnpzw"
      },
      "question": "Problem B-3\nLet \\( qzxwvtnp \\) be the probability that \\( hjgrksla+mnlpqrst \\) is a perfect square when the integers \\( hjgrksla \\) and \\( mnlpqrst \\) are selected independently at random from the set \\( \\{1,2,3, \\ldots, gnbshplt\\} \\). Show that \\( \\lim _{gnbshplt \\rightarrow \\infty}\\left(qzxwvtnp \\sqrt{gnbshplt}\\right) \\) exists and express this limit in the form \\( xckptfma(\\sqrt{qrlgnpzw}-1) \\). where \\( qrlgnpzw \\) and \\( vrwzcpky \\) are integers and \\( xckptfma \\) is a rational number.",
      "solution": "B-3.\nLet \\( slqzmhvd(gnbshplt)=[\\sqrt{gnbshplt+1}] \\) and \\( kjptwqxr(gnbshplt)=[\\sqrt{2 gnbshplt}] \\), where \\( [x] \\) is the greatest integer in \\( x \\). For \\( vrwzcpky \\) in \\( \\{1,2, \\ldots, slqzmhvd(gnbshplt)\\} \\), there are \\( vrwzcpky^{2}-1 \\) ordered pairs \\( (hjgrksla, mnlpqrst) \\) with \\( hjgrksla \\) and \\( mnlpqrst \\) in \\( zbfruoyg=\\{1,2, \\ldots, gnbshplt\\} \\) and \\( hjgrksla+mnlpqrst=vrwzcpky^{2} \\). For \\( vrwzcpky \\) in \\( \\{1+slqzmhvd(gnbshplt), 2+slqzmhvd(gnbshplt), \\ldots, kjptwqxr(gnbshplt)\\} \\), there are \\( 2 gnbshplt+1-vrwzcpky^{2} \\) ordered pairs \\( (hjgrksla, mnlpqrst) \\) with \\( hjgrksla \\) and \\( mnlpqrst \\) in \\( zbfruoyg \\) and \\( hjgrksla+mnlpqrst=vrwzcpky^{2} \\). Hence the total number \\( wldjskrp(gnbshplt) \\) of favorable \\( (hjgrksla, mnlpqrst) \\) is\n\\[\n\\begin{aligned}\nwldjskrp(gnbshplt)= & \\sum_{vrwzcpky=1}^{slqzmhvd(gnbshplt)}\\left(vrwzcpky^{2}-1\\right)+\\sum_{vrwzcpky=1+slqzmhvd(gnbshplt)}^{kjptwqxr(gnbshplt)}\\left(2 gnbshplt+1-vrwzcpky^{2}\\right) \\\\\n= & \\left(2 \\sum_{vrwzcpky=1}^{slqzmhvd(gnbshplt)} vrwzcpky^{2}\\right)-\\left(\\sum_{vrwzcpky=1}^{kjptwqxr(gnbshplt)} vrwzcpky^{2}\\right)-slqzmhvd(gnbshplt)+[kjptwqxr(gnbshplt)-slqzmhvd(gnbshplt)](2 gnbshplt+1) \\\\\n= & \\frac{2\\, slqzmhvd(gnbshplt)[1+slqzmhvd(gnbshplt)][1+2\\, slqzmhvd(gnbshplt)]}{6}-\\frac{kjptwqxr(gnbshplt)[1+kjptwqxr(gnbshplt)][1+2\\, kjptwqxr(gnbshplt)]}{6} \\\\\n& -2(gnbshplt+1)\\, slqzmhvd(gnbshplt)+(2 gnbshplt+1)\\, kjptwqxr(gnbshplt) .\n\\end{aligned}\n\\]\n\nSince \\( qzxwvtnp=wldjskrp(gnbshplt) / gnbshplt^{2} \\),\n\\[\n\\begin{aligned}\n\\lim _{gnbshplt \\rightarrow \\infty}\\left(qzxwvtnp \\sqrt{gnbshplt}\\right) & =\\lim _{gnbshplt \\rightarrow \\infty} wldjskrp(gnbshplt) / gnbshplt^{3 / 2} \\\\\n& =\\frac{2 \\cdot 2}{6} \\lim _{gnbshplt \\rightarrow \\infty}\\left(\\frac{slqzmhvd(gnbshplt)}{\\sqrt{gnbshplt}}\\right)^{3}-\\frac{2}{6} \\lim _{gnbshplt \\rightarrow \\infty}\\left(\\frac{kjptwqxr(gnbshplt)}{\\sqrt{gnbshplt}}\\right)^{3}-2 \\lim _{gnbshplt \\rightarrow \\infty} \\frac{slqzmhvd(gnbshplt)}{\\sqrt{gnbshplt}}+2 \\lim _{gnbshplt \\rightarrow \\infty} \\frac{kjptwqxr(gnbshplt)}{\\sqrt{gnbshplt}} \\\\\n& =\\frac{2}{3}-\\frac{1}{3}(\\sqrt{2})^{3}-2+2 \\sqrt{2}=\\frac{4}{3}(\\sqrt{2}-1)\n\\end{aligned}\n\\]"
    },
    "kernel_variant": {
      "question": "Fix an odd positive integer  \n  m  (so that 2 is invertible modulo m).\n\nFor every n∈ℕ put  \n  Xₙ := {5,6,7,…,n+4}.\n\nChoose two integers c and d independently and uniformly at random from Xₙ and define  \n\n  pₙ := P[(A) c+d is a perfect square,  \n      (B) c ≡ d (mod m), and  \n      (C) c and d have opposite parity].\n\nProve that the limit  \n\n  L(m) := lim_{n→∞} (pₙ √n)\n\nexists and that  \n\n  L(m) = (2 / 3m)·(√2 − 1).\n\n(For m = 1 we recover the classical constant (2/3)(√2−1); the modular restriction divides the constant by m, while the parity requirement removes the factor 2 that appears in the AIME 1994 problem.)\n\n———————————————————————————————————————",
      "solution": "Throughout “pair’’ means ordered pair (c,d); all implied constants are absolute.\n\n0.  Basic reformulation  \nLet  \n\n  F(n) := # {(c,d)∈Xₙ² : (A), (B), (C) hold}.                      (1)\n\nBecause |Xₙ| = n,  \n\n  pₙ = F(n)/n²  ⇒  pₙ√n = F(n)/n^{3/2}.                    (2)\n\nHence we need an asymptotic expansion for F(n).\n\n─────────────────────────────────────────────────────────────────────\n1.  Pairs whose sum is a square after the +4 shift  \nWrite  \n\n  S(n) := # {(c,d)∈Xₙ² : c+d is a perfect square}.             (3)\n\nDenote, for 1≤s≤2n,  \n\n  Rₙ(s) := # {(u,v)∈[1,n]² : u+v=s}  \n       = max(0, min(s−1, 2n+1−s)).                       (4)\n\nFor Xₙ the translation (c,d)↦(c−4,d−4) sends Xₙ² bijectively onto [1,n]², and\n\n  # {(c,d)∈Xₙ² : c+d=s} = Rₙ(s−8).                            (5)\n\nHence, if s_k:=k²,\n\n  S(n)=∑_{k≥1} Rₙ(s_k−8).                                     (6)\n\nClassically (AIME 1994)  \n\n  S₀(n):=∑_{k≥1} Rₙ(s_k)= (4/3)(√2−1) n^{3/2}+O(n).         (7)\n\nWe compare S(n) and S₀(n).\n\nFix k with s_k≤2n+8.  If both s_k and s_k−8 lie in [2,2n] then, because Rₙ is 1-Lipschitz,  \n\n  |Rₙ(s_k−8)−Rₙ(s_k)|≤8.                                (8)\n\nThere are ⌊√(2n+8)⌋ terms, giving a contribution O(√n).\n\nIf exactly one of s_k, s_k−8 lies in [2,2n], then s_k is within 8 of an endpoint of that interval; at most 16 such k occur, each contributing ≤n.  Therefore\n\n  |S(n)−S₀(n)| = O(n).                                     (9)\n\nInserting (7) we obtain  \n\n  S(n)= (4/3)(√2−1) n^{3/2}+O(n).                        (10)\n\n─────────────────────────────────────────────────────────────────────\n2.  Keeping only odd squares – parity filter (C)  \nLet  \n\n  S_odd(n):=# {(c,d)∈Xₙ² : c+d is an odd square}.           (11)\n\nWrite α_k := Rₙ(s_k−8).  Then S(n)=∑_{k≥1}α_k and S_odd(n)=∑_{k odd}α_k.  Observe  \n\n  |α_{k+1}−α_k| ≤ s_{k+1}−s_k = 2k+1.                   (12)\n\nHence  \n\n  S_odd(n)−S_even(n)=∑_{j=1}^{⌊K/2⌋}(α_{2j−1}−α_{2j}), where K≈√(2n).  \n  |α_{2j−1}−α_{2j}|≤4j−1, so\n\n  |S_odd(n)−S_even(n)| ≤ ∑_{j≤√(2n)} (4j) = O(n).      (13)\n\nBecause S(n)=S_odd(n)+S_even(n) we deduce  \n\n  S_odd(n)=½S(n)+O(n)  \n      = (2/3)(√2−1) n^{3/2}+O(n).                    (14)\n\nRemark: the error term can in fact be sharpened to O(√n), but O(n) suffices for our limit.\n\n─────────────────────────────────────────────────────────────────────\n3.  Imposing the congruence c ≡ d (mod m)  \nFix an odd square S and set  \n\n  I_S := {c∈Xₙ : S−c∈Xₙ}.                               (15)\n\nI_S is an interval whose length α_S:=|I_S| obeys 1≤α_S≤n and\n\n  ∑_{S odd square}α_S = S_odd(n).                       (16)\n\nBecause m is odd, 2 is invertible modulo m.  Setting  \n  c ≡ 2^{−1}S (mod m)                                   (17)\nensures (B); for each S there is exactly one residue class.  Among α_S consecutive integers that class occurs either ⌊α_S/m⌋ or ⌈α_S/m⌉ times, i.e.\n\n  # {c∈I_S : (B)} = α_S/m + ε_S,  |ε_S|≤1.           (18)\n\nEach such c determines d uniquely; since S is odd, (C) is automatic.  Summing (18) over all relevant odd squares yields\n\n  F(n)= (1/m) S_odd(n) + E(n),  |E(n)|≤∑|ε_S|=O(√n).   (19)\n\n─────────────────────────────────────────────────────────────────────\n4.  Asymptotics of F(n) and the limit  \nInsert (14) into (19):\n\n  F(n)= (1/m)·(2/3)(√2−1) n^{3/2} + O(n).               (20)\n\nFinally, by (2),\n\n  pₙ√n = F(n)/n^{3/2}  \n      = (2/3m)(√2−1) + O(1/√n).                      (21)\n\nHence the limit exists and equals  \n\n  L(m)= (2/3m)(√2 − 1). □\n\n———————————————————————————————————————",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T19:09:31.666372",
        "was_fixed": false,
        "difficulty_analysis": "•  Multiple interacting constraints  \n   The original kernel variant dealt only with the square–sum condition.  The\n   enhanced version imposes two further, logically independent constraints: a\n   congruence on the difference (B) and a parity requirement (C).  Their\n   interaction with the square condition forces separate analyses of the even and\n   odd squares, a careful use of modular arithmetic (invertibility of 2 mod m),\n   and the isolation of boundary terms that were absent in the original problem.\n\n•  Use of finer arithmetic structure  \n   Unlike the original solution, which needed only a single summation over the\n   square indices t, the enhanced solution must decompose that sum into even and\n   odd parts, work inside individual residue classes modulo m, and solve a\n   family of linear congruences to count admissible pairs.  This brings in tools\n   from elementary algebraic number theory (Chinese Remainder Theorem, units\n   modulo m) that never appeared in the original argument.\n\n•  Asymptotic independence is no longer obvious  \n   Showing that the extra conditions merely scale the leading term by the factor\n   1⁄(2m) requires proving an approximate statistical independence between the\n   “square–sum” property and simultaneity of the modular / parity constraints, an\n   argument that relies on delicate error estimates (the o(1) remainders in\n   steps (3) and (4)).  None of this is needed for the parent problem.\n\n•  Deeper combinatorial bookkeeping  \n   The pair–count now proceeds in three nested levels:  \n  – counting solutions of c + d = S,  \n  – selecting the odd-square values of S,  \n  – filtering by a linear modular condition.  \n   Each layer preserves or modifies the asymptotic main term in a different way,\n   so the solver must keep exact track of constants through several reductions.\n\nBecause of these additional layers of modular, parity and asymptotic reasoning,\nthe enhanced kernel variant is substantially more intricate than both the\noriginal AIME problem and the simpler “shifted–interval” kernel variant."
      }
    },
    "original_kernel_variant": {
      "question": "Fix an odd positive integer  \n  m  (so that 2 is invertible modulo m).\n\nFor every n∈ℕ put  \n  Xₙ := {5,6,7,…,n+4}.\n\nChoose two integers c and d independently and uniformly at random from Xₙ and define  \n\n  pₙ := P[(A) c+d is a perfect square,  \n      (B) c ≡ d (mod m), and  \n      (C) c and d have opposite parity].\n\nProve that the limit  \n\n  L(m) := lim_{n→∞} (pₙ √n)\n\nexists and that  \n\n  L(m) = (2 / 3m)·(√2 − 1).\n\n(For m = 1 we recover the classical constant (2/3)(√2−1); the modular restriction divides the constant by m, while the parity requirement removes the factor 2 that appears in the AIME 1994 problem.)\n\n———————————————————————————————————————",
      "solution": "Throughout “pair’’ means ordered pair (c,d); all implied constants are absolute.\n\n0.  Basic reformulation  \nLet  \n\n  F(n) := # {(c,d)∈Xₙ² : (A), (B), (C) hold}.                      (1)\n\nBecause |Xₙ| = n,  \n\n  pₙ = F(n)/n²  ⇒  pₙ√n = F(n)/n^{3/2}.                    (2)\n\nHence we need an asymptotic expansion for F(n).\n\n─────────────────────────────────────────────────────────────────────\n1.  Pairs whose sum is a square after the +4 shift  \nWrite  \n\n  S(n) := # {(c,d)∈Xₙ² : c+d is a perfect square}.             (3)\n\nDenote, for 1≤s≤2n,  \n\n  Rₙ(s) := # {(u,v)∈[1,n]² : u+v=s}  \n       = max(0, min(s−1, 2n+1−s)).                       (4)\n\nFor Xₙ the translation (c,d)↦(c−4,d−4) sends Xₙ² bijectively onto [1,n]², and\n\n  # {(c,d)∈Xₙ² : c+d=s} = Rₙ(s−8).                            (5)\n\nHence, if s_k:=k²,\n\n  S(n)=∑_{k≥1} Rₙ(s_k−8).                                     (6)\n\nClassically (AIME 1994)  \n\n  S₀(n):=∑_{k≥1} Rₙ(s_k)= (4/3)(√2−1) n^{3/2}+O(n).         (7)\n\nWe compare S(n) and S₀(n).\n\nFix k with s_k≤2n+8.  If both s_k and s_k−8 lie in [2,2n] then, because Rₙ is 1-Lipschitz,  \n\n  |Rₙ(s_k−8)−Rₙ(s_k)|≤8.                                (8)\n\nThere are ⌊√(2n+8)⌋ terms, giving a contribution O(√n).\n\nIf exactly one of s_k, s_k−8 lies in [2,2n], then s_k is within 8 of an endpoint of that interval; at most 16 such k occur, each contributing ≤n.  Therefore\n\n  |S(n)−S₀(n)| = O(n).                                     (9)\n\nInserting (7) we obtain  \n\n  S(n)= (4/3)(√2−1) n^{3/2}+O(n).                        (10)\n\n─────────────────────────────────────────────────────────────────────\n2.  Keeping only odd squares – parity filter (C)  \nLet  \n\n  S_odd(n):=# {(c,d)∈Xₙ² : c+d is an odd square}.           (11)\n\nWrite α_k := Rₙ(s_k−8).  Then S(n)=∑_{k≥1}α_k and S_odd(n)=∑_{k odd}α_k.  Observe  \n\n  |α_{k+1}−α_k| ≤ s_{k+1}−s_k = 2k+1.                   (12)\n\nHence  \n\n  S_odd(n)−S_even(n)=∑_{j=1}^{⌊K/2⌋}(α_{2j−1}−α_{2j}), where K≈√(2n).  \n  |α_{2j−1}−α_{2j}|≤4j−1, so\n\n  |S_odd(n)−S_even(n)| ≤ ∑_{j≤√(2n)} (4j) = O(n).      (13)\n\nBecause S(n)=S_odd(n)+S_even(n) we deduce  \n\n  S_odd(n)=½S(n)+O(n)  \n      = (2/3)(√2−1) n^{3/2}+O(n).                    (14)\n\nRemark: the error term can in fact be sharpened to O(√n), but O(n) suffices for our limit.\n\n─────────────────────────────────────────────────────────────────────\n3.  Imposing the congruence c ≡ d (mod m)  \nFix an odd square S and set  \n\n  I_S := {c∈Xₙ : S−c∈Xₙ}.                               (15)\n\nI_S is an interval whose length α_S:=|I_S| obeys 1≤α_S≤n and\n\n  ∑_{S odd square}α_S = S_odd(n).                       (16)\n\nBecause m is odd, 2 is invertible modulo m.  Setting  \n  c ≡ 2^{−1}S (mod m)                                   (17)\nensures (B); for each S there is exactly one residue class.  Among α_S consecutive integers that class occurs either ⌊α_S/m⌋ or ⌈α_S/m⌉ times, i.e.\n\n  # {c∈I_S : (B)} = α_S/m + ε_S,  |ε_S|≤1.           (18)\n\nEach such c determines d uniquely; since S is odd, (C) is automatic.  Summing (18) over all relevant odd squares yields\n\n  F(n)= (1/m) S_odd(n) + E(n),  |E(n)|≤∑|ε_S|=O(√n).   (19)\n\n─────────────────────────────────────────────────────────────────────\n4.  Asymptotics of F(n) and the limit  \nInsert (14) into (19):\n\n  F(n)= (1/m)·(2/3)(√2−1) n^{3/2} + O(n).               (20)\n\nFinally, by (2),\n\n  pₙ√n = F(n)/n^{3/2}  \n      = (2/3m)(√2−1) + O(1/√n).                      (21)\n\nHence the limit exists and equals  \n\n  L(m)= (2/3m)(√2 − 1). □\n\n———————————————————————————————————————",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T01:37:45.522746",
        "was_fixed": false,
        "difficulty_analysis": "•  Multiple interacting constraints  \n   The original kernel variant dealt only with the square–sum condition.  The\n   enhanced version imposes two further, logically independent constraints: a\n   congruence on the difference (B) and a parity requirement (C).  Their\n   interaction with the square condition forces separate analyses of the even and\n   odd squares, a careful use of modular arithmetic (invertibility of 2 mod m),\n   and the isolation of boundary terms that were absent in the original problem.\n\n•  Use of finer arithmetic structure  \n   Unlike the original solution, which needed only a single summation over the\n   square indices t, the enhanced solution must decompose that sum into even and\n   odd parts, work inside individual residue classes modulo m, and solve a\n   family of linear congruences to count admissible pairs.  This brings in tools\n   from elementary algebraic number theory (Chinese Remainder Theorem, units\n   modulo m) that never appeared in the original argument.\n\n•  Asymptotic independence is no longer obvious  \n   Showing that the extra conditions merely scale the leading term by the factor\n   1⁄(2m) requires proving an approximate statistical independence between the\n   “square–sum” property and simultaneity of the modular / parity constraints, an\n   argument that relies on delicate error estimates (the o(1) remainders in\n   steps (3) and (4)).  None of this is needed for the parent problem.\n\n•  Deeper combinatorial bookkeeping  \n   The pair–count now proceeds in three nested levels:  \n  – counting solutions of c + d = S,  \n  – selecting the odd-square values of S,  \n  – filtering by a linear modular condition.  \n   Each layer preserves or modifies the asymptotic main term in a different way,\n   so the solver must keep exact track of constants through several reductions.\n\nBecause of these additional layers of modular, parity and asymptotic reasoning,\nthe enhanced kernel variant is substantially more intricate than both the\noriginal AIME problem and the simpler “shifted–interval” kernel variant."
      }
    }
  },
  "checked": true,
  "problem_type": "proof"
}