{
  "index": "1987-A-2",
  "type": "NT",
  "tag": [
    "NT",
    "COMB"
  ],
  "difficulty": "",
  "question": "The sequence of digits\n\\[\n1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 \\dots\n\\]\nis obtained by writing the positive integers in order. If the\n$10^n$-th digit in this sequence occurs in the part of the sequence in\nwhich the $m$-digit numbers are placed, define $f(n)$ to be $m$. For\nexample, $f(2)=2$ because the 100th digit enters the sequence in the\nplacement of the two-digit integer 55. Find, with proof, $f(1987)$.",
  "solution": "Solution. Let \\( g(m) \\) denote the total number of digits in the integers with \\( m \\) or fewer digits. Then \\( f(n) \\) equals the integer \\( m \\) such that \\( g(m-1)<10^{n} \\leq g(m) \\).\n\nThere are \\( 10^{r}-10^{r-1} \\) numbers with exactly \\( r \\) digits, so \\( g(m)=\\sum_{r=1}^{m} r\\left(10^{r}-10^{r-1}\\right) \\). We have\n\\[\ng(1983) \\leq \\sum_{r=1}^{1983} 1983\\left(10^{r}-10^{r-1}\\right) \\leq 1983 \\cdot 10^{1983}<10^{1987}\n\\]\nand\n\\[\ng(1984) \\geq 1984\\left(10^{1984}-10^{1983}\\right)=1984 \\cdot 9 \\cdot 10^{1983}>10^{4} \\cdot 10^{1983}=10^{1987}\n\\]\nso \\( f(1987)=1984 \\).\nMotivation. Based on the growth of geometric series one might guess that \\( g(m) \\) has size roughly equal to its top term, which is \\( 9 \\cdot m \\cdot 10^{m-1} \\). Thus we seek \\( m \\) such that \\( 9 \\cdot m \\cdot 10^{m-1} \\approx 10^{1987} \\). Using \\( 9 \\approx 10 \\), the condition becomes \\( m \\approx 10^{1987-m} \\). This leads to the guess \\( m=1984 \\), since \\( 1984 \\approx 10^{3} \\).\n\nRemark. There is a closed form for \\( g(m) \\) :\n\\[\n\\begin{aligned}\ng(m) & =\\sum_{r=1}^{m} r 10^{r}-\\sum_{r=1}^{m} r 10^{r-1} \\\\\n& =\\sum_{r=1}^{m} r 10^{r}-\\sum_{s=0}^{m-1}(s+1) 10^{s} \\\\\n& =\\left(m 10^{m}+\\sum_{r=0}^{m-1} r 10^{r}\\right)-\\sum_{s=0}^{m-1}(s+1) 10^{s} \\\\\n& =m 10^{m}-\\sum_{s=0}^{m-1} 10^{s} \\\\\n& =m 10^{m}-\\left(10^{m}-1\\right) / 9\n\\end{aligned}\n\\]\n\nMore generally, there is a closed form for \\( \\sum_{r=a}^{b} P(r) x^{r} \\) for any integers \\( a \\leq b \\), fixed polynomial \\( P \\), and number \\( x \\). Rearrangement as above shows that\n\\[\n(1-x) \\sum_{r=a}^{b} P(r) x^{r}=P(a) x^{a}-P(b) x^{b+1}+\\sum_{r=a+1}^{b}(P(r)-P(r-1)) x^{r}\n\\]\nand the last sum is of the same type but with a polynomial \\( P(r)-P(r-1) \\) of lower degree than \\( P \\), or zero if \\( P \\) was constant to begin with. Hence one can evaluate the sum by induction on \\( \\operatorname{deg} P \\).\n\nAlternatively, \\( \\sum_{r=a}^{b} P(r) x^{r} \\) can be evaluated by repeatedly differentiating the formula for the geometric series\n\\[\n\\sum_{r=a}^{b} x^{r}=\\frac{x^{b+1}-x^{a}}{x-1}\n\\]\nand taking linear combinations of the resulting identities.",
  "vars": [
    "n",
    "m",
    "f",
    "g",
    "r",
    "s",
    "a",
    "b",
    "P",
    "x"
  ],
  "params": [],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "n": "powindex",
        "m": "numdigits",
        "f": "mappingfunc",
        "g": "cumulativefunc",
        "r": "iterindex",
        "s": "shiftindex",
        "a": "lowerbound",
        "b": "upperbound",
        "P": "polynomial",
        "x": "basenumber"
      },
      "question": "The sequence of digits\n\\[\n1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 \\dots\n\\]\nis obtained by writing the positive integers in order. If the\n$10^{powindex}$-th digit in this sequence occurs in the part of the sequence in\nwhich the $numdigits$-digit numbers are placed, define $mappingfunc(powindex)$ to be $numdigits$. For\nexample, $mappingfunc(2)=2$ because the 100th digit enters the sequence in the\nplacement of the two-digit integer 55. Find, with proof, $mappingfunc(1987)$.",
      "solution": "Solution. Let \\( cumulativefunc(numdigits) \\) denote the total number of digits in the integers with \\( numdigits \\) or fewer digits. Then \\( mappingfunc(powindex) \\) equals the integer \\( numdigits \\) such that \\( cumulativefunc(numdigits-1)<10^{powindex} \\leq cumulativefunc(numdigits) \\).\n\nThere are \\( 10^{iterindex}-10^{iterindex-1} \\) numbers with exactly \\( iterindex \\) digits, so\n\\[\ncumulativefunc(numdigits)=\\sum_{iterindex=1}^{numdigits} iterindex\\left(10^{iterindex}-10^{iterindex-1}\\right).\n\\]\nWe have\n\\[\ncumulativefunc(1983) \\leq \\sum_{iterindex=1}^{1983} 1983\\left(10^{iterindex}-10^{iterindex-1}\\right) \\leq 1983 \\cdot 10^{1983}<10^{1987}\n\\]\nand\n\\[\ncumulativefunc(1984) \\geq 1984\\left(10^{1984}-10^{1983}\\right)=1984 \\cdot 9 \\cdot 10^{1983}>10^{4} \\cdot 10^{1983}=10^{1987},\n\\]\nso \\( mappingfunc(1987)=1984 \\).\n\nMotivation. Based on the growth of geometric series one might guess that \\( cumulativefunc(numdigits) \\) has size roughly equal to its top term, which is \\( 9 \\cdot numdigits \\cdot 10^{numdigits-1} \\). Thus we seek \\( numdigits \\) such that \\( 9 \\cdot numdigits \\cdot 10^{numdigits-1} \\approx 10^{1987} \\). Using \\( 9 \\approx 10 \\), the condition becomes \\( numdigits \\approx 10^{1987-numdigits} \\). This leads to the guess \\( numdigits=1984 \\), since \\( 1984 \\approx 10^{3} \\).\n\nRemark. There is a closed form for \\( cumulativefunc(numdigits) \\) :\n\\[\n\\begin{aligned}\ncumulativefunc(numdigits) & =\\sum_{iterindex=1}^{numdigits} iterindex 10^{iterindex}-\\sum_{iterindex=1}^{numdigits} iterindex 10^{iterindex-1} \\\\\n& =\\sum_{iterindex=1}^{numdigits} iterindex 10^{iterindex}-\\sum_{shiftindex=0}^{numdigits-1}(shiftindex+1) 10^{shiftindex} \\\\\n& =\\left(numdigits 10^{numdigits}+\\sum_{iterindex=0}^{numdigits-1} iterindex 10^{iterindex}\\right)-\\sum_{shiftindex=0}^{numdigits-1}(shiftindex+1) 10^{shiftindex} \\\\\n& =numdigits 10^{numdigits}-\\sum_{shiftindex=0}^{numdigits-1} 10^{shiftindex} \\\\\n& =numdigits 10^{numdigits}-\\left(10^{numdigits}-1\\right) / 9 .\n\\end{aligned}\n\\]\n\nMore generally, there is a closed form for \\( \\sum_{iterindex=lowerbound}^{upperbound} polynomial(iterindex) basenumber^{iterindex} \\) for any integers \\( lowerbound \\leq upperbound \\), fixed polynomial \\( polynomial \\), and number \\( basenumber \\). Rearrangement as above shows that\n\\[\n(1-basenumber) \\sum_{iterindex=lowerbound}^{upperbound} polynomial(iterindex) basenumber^{iterindex}=polynomial(lowerbound) basenumber^{lowerbound}-polynomial(upperbound) basenumber^{upperbound+1}+\\sum_{iterindex=lowerbound+1}^{upperbound}(polynomial(iterindex)-polynomial(iterindex-1)) basenumber^{iterindex},\n\\]\nand the last sum is of the same type but with a polynomial \\( polynomial(iterindex)-polynomial(iterindex-1) \\) of lower degree than \\( polynomial \\), or zero if \\( polynomial \\) was constant to begin with. Hence one can evaluate the sum by induction on \\( \\operatorname{deg} polynomial \\).\n\nAlternatively, \\( \\sum_{iterindex=lowerbound}^{upperbound} polynomial(iterindex) basenumber^{iterindex} \\) can be evaluated by repeatedly differentiating the formula for the geometric series\n\\[\n\\sum_{iterindex=lowerbound}^{upperbound} basenumber^{iterindex}=\\frac{basenumber^{upperbound+1}-basenumber^{lowerbound}}{basenumber-1}\n\\]\nand taking linear combinations of the resulting identities."
    },
    "descriptive_long_confusing": {
      "map": {
        "n": "juniperns",
        "m": "daisypath",
        "f": "pebblemix",
        "g": "lanternfly",
        "r": "quilltree",
        "s": "driftwood",
        "a": "honeycomb",
        "b": "starlight",
        "P": "sunflower",
        "x": "moonstone"
      },
      "question": "The sequence of digits\n\\[\n1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 \\dots\n\\]\nis obtained by writing the positive integers in order. If the\n$10^{juniperns}$-th digit in this sequence occurs in the part of the sequence in\nwhich the daisypath-digit numbers are placed, define $pebblemix(juniperns)$ to be daisypath. For\nexample, $pebblemix(2)=2$ because the 100th digit enters the sequence in the\nplacement of the two-digit integer 55. Find, with proof, $pebblemix(1987)$.",
      "solution": "Solution. Let \\( lanternfly(daisypath) \\) denote the total number of digits in the integers with \\( daisypath \\) or fewer digits. Then \\( pebblemix(juniperns) \\) equals the integer \\( daisypath \\) such that \\( lanternfly(daisypath-1)<10^{juniperns} \\leq lanternfly(daisypath) \\).\n\nThere are \\( 10^{quilltree}-10^{quilltree-1} \\) numbers with exactly \\( quilltree \\) digits, so \\( lanternfly(daisypath)=\\sum_{quilltree=1}^{daisypath} quilltree\\left(10^{quilltree}-10^{quilltree-1}\\right) \\). We have\n\\[\nlanternfly(1983) \\leq \\sum_{quilltree=1}^{1983} 1983\\left(10^{quilltree}-10^{quilltree-1}\\right) \\leq 1983 \\cdot 10^{1983}<10^{1987}\n\\]\nand\n\\[\nlanternfly(1984) \\geq 1984\\left(10^{1984}-10^{1983}\\right)=1984 \\cdot 9 \\cdot 10^{1983}>10^{4} \\cdot 10^{1983}=10^{1987}\n\\]\nso \\( pebblemix(1987)=1984 \\).\n\nMotivation. Based on the growth of geometric series one might guess that \\( lanternfly(daisypath) \\) has size roughly equal to its top term, which is \\( 9 \\cdot daisypath \\cdot 10^{daisypath-1} \\). Thus we seek \\( daisypath \\) such that \\( 9 \\cdot daisypath \\cdot 10^{daisypath-1} \\approx 10^{1987} \\). Using \\( 9 \\approx 10 \\), the condition becomes \\( daisypath \\approx 10^{1987-daisypath} \\). This leads to the guess \\( daisypath=1984 \\), since \\( 1984 \\approx 10^{3} \\).\n\nRemark. There is a closed form for \\( lanternfly(daisypath) \\) :\n\\[\n\\begin{aligned}\nlanternfly(daisypath) & =\\sum_{quilltree=1}^{daisypath} quilltree 10^{quilltree}-\\sum_{quilltree=1}^{daisypath} quilltree 10^{quilltree-1} \\\\\n& =\\sum_{quilltree=1}^{daisypath} quilltree 10^{quilltree}-\\sum_{driftwood=0}^{daisypath-1}(driftwood+1) 10^{driftwood} \\\\\n& =\\left(daisypath 10^{daisypath}+\\sum_{quilltree=0}^{daisypath-1} quilltree 10^{quilltree}\\right)-\\sum_{driftwood=0}^{daisypath-1}(driftwood+1) 10^{driftwood} \\\\\n& =daisypath 10^{daisypath}-\\sum_{driftwood=0}^{daisypath-1} 10^{driftwood} \\\\\n& =daisypath 10^{daisypath}-\\left(10^{daisypath}-1\\right) / 9\n\\end{aligned}\n\\]\n\nMore generally, there is a closed form for \\( \\sum_{quilltree=honeycomb}^{starlight} sunflower(quilltree) moonstone^{quilltree} \\) for any integers \\( honeycomb \\leq starlight \\), fixed polynomial \\( sunflower \\), and number \\( moonstone \\). Rearrangement as above shows that\n\\[\n(1-moonstone) \\sum_{quilltree=honeycomb}^{starlight} sunflower(quilltree) moonstone^{quilltree}=sunflower(honeycomb) moonstone^{honeycomb}-sunflower(starlight) moonstone^{starlight+1}+\\sum_{quilltree=honeycomb+1}^{starlight}(sunflower(quilltree)-sunflower(quilltree-1)) moonstone^{quilltree}\n\\]\nand the last sum is of the same type but with a polynomial \\( sunflower(quilltree)-sunflower(quilltree-1) \\) of lower degree than \\( sunflower \\), or zero if \\( sunflower \\) was constant to begin with. Hence one can evaluate the sum by induction on \\( \\operatorname{deg} sunflower \\).\n\nAlternatively, \\( \\sum_{quilltree=honeycomb}^{starlight} sunflower(quilltree) moonstone^{quilltree} \\) can be evaluated by repeatedly differentiating the formula for the geometric series\n\\[\n\\sum_{quilltree=honeycomb}^{starlight} moonstone^{quilltree}=\\frac{moonstone^{starlight+1}-moonstone^{honeycomb}}{moonstone-1}\n\\]\nand taking linear combinations of the resulting identities."
    },
    "descriptive_long_misleading": {
      "map": {
        "n": "continuum",
        "m": "infinite",
        "f": "staticval",
        "g": "diminish",
        "r": "reststop",
        "s": "stillness",
        "a": "endingpt",
        "b": "starting",
        "P": "constant",
        "x": "knownval"
      },
      "question": "The sequence of digits\n\\[\n1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 \\dots\n\\]\nis obtained by writing the positive integers in order. If the $10^{continuum}$-th digit in this sequence occurs in the part of the sequence in which the $infinite$-digit numbers are placed, define $staticval(continuum)$ to be $infinite$. For example, $staticval(2)=2$ because the 100th digit enters the sequence in the placement of the two-digit integer 55. Find, with proof, $staticval(1987)$.",
      "solution": "Solution. Let \\( diminish(infinite) \\) denote the total number of digits in the integers with \\( infinite \\) or fewer digits. Then \\( staticval(continuum) \\) equals the integer \\( infinite \\) such that \\( diminish(infinite-1)<10^{continuum} \\leq diminish(infinite) \\).\n\nThere are \\( 10^{reststop}-10^{reststop-1} \\) numbers with exactly \\( reststop \\) digits, so \\( diminish(infinite)=\\sum_{reststop=1}^{infinite} reststop\\left(10^{reststop}-10^{reststop-1}\\right) \\). We have\n\\[\ndiminish(1983) \\leq \\sum_{reststop=1}^{1983} 1983\\left(10^{reststop}-10^{reststop-1}\\right) \\leq 1983 \\cdot 10^{1983}<10^{1987}\n\\]\nand\n\\[\ndiminish(1984) \\geq 1984\\left(10^{1984}-10^{1983}\\right)=1984 \\cdot 9 \\cdot 10^{1983}>10^{4} \\cdot 10^{1983}=10^{1987}\n\\]\nso \\( staticval(1987)=1984 \\).\nMotivation. Based on the growth of geometric series one might guess that \\( diminish(infinite) \\) has size roughly equal to its top term, which is \\( 9 \\cdot infinite \\cdot 10^{infinite-1} \\). Thus we seek \\( infinite \\) such that \\( 9 \\cdot infinite \\cdot 10^{infinite-1} \\approx 10^{1987} \\). Using \\( 9 \\approx 10 \\), the condition becomes \\( infinite \\approx 10^{1987-infinite} \\). This leads to the guess \\( infinite=1984 \\), since \\( 1984 \\approx 10^{3} \\).\n\nRemark. There is a closed form for \\( diminish(infinite) \\) :\n\\[\n\\begin{aligned}\ndiminish(infinite) & =\\sum_{reststop=1}^{infinite} reststop 10^{reststop}-\\sum_{reststop=1}^{infinite} reststop 10^{reststop-1} \\\\\n& =\\sum_{reststop=1}^{infinite} reststop 10^{reststop}-\\sum_{stillness=0}^{infinite-1}(stillness+1) 10^{stillness} \\\\\n& =\\left(infinite 10^{infinite}+\\sum_{reststop=0}^{infinite-1} reststop 10^{reststop}\\right)-\\sum_{stillness=0}^{infinite-1}(stillness+1) 10^{stillness} \\\\\n& =infinite 10^{infinite}-\\sum_{stillness=0}^{infinite-1} 10^{stillness} \\\\\n& =infinite 10^{infinite}-\\left(10^{infinite}-1\\right) / 9\n\\end{aligned}\n\\]\n\nMore generally, there is a closed form for \\( \\sum_{reststop=endingpt}^{starting} constant(reststop) knownval^{reststop} \\) for any integers \\( endingpt \\leq starting \\), fixed polynomial \\( constant \\), and number \\( knownval \\). Rearrangement as above shows that\n\\[\n(1-knownval) \\sum_{reststop=endingpt}^{starting} constant(reststop) knownval^{reststop}=constant(endingpt) knownval^{endingpt}-constant(starting) knownval^{starting+1}+\\sum_{reststop=endingpt+1}^{starting}(constant(reststop)-constant(reststop-1)) knownval^{reststop}\n\\]\nand the last sum is of the same type but with a polynomial \\( constant(reststop)-constant(reststop-1) \\) of lower degree than \\( constant \\), or zero if \\( constant \\) was constant to begin with. Hence one can evaluate the sum by induction on \\( \\operatorname{deg} constant \\).\n\nAlternatively, \\( \\sum_{reststop=endingpt}^{starting} constant(reststop) knownval^{reststop} \\) can be evaluated by repeatedly differentiating the formula for the geometric series\n\\[\n\\sum_{reststop=endingpt}^{starting} knownval^{reststop}=\\frac{knownval^{starting+1}-knownval^{endingpt}}{knownval-1}\n\\]\nand taking linear combinations of the resulting identities."
    },
    "garbled_string": {
      "map": {
        "n": "qzxwvtnp",
        "m": "hjgrksla",
        "f": "vbnxclqw",
        "g": "rtyuipas",
        "r": "mnbvcxzq",
        "s": "plmoknij",
        "a": "zlkjhgfq",
        "b": "poiuytre",
        "P": "qazwsxed",
        "x": "wsxcvbnm"
      },
      "question": "The sequence of digits\n\\[\n1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 \\dots\n\\]\nis obtained by writing the positive integers in order. If the $10^{qzxwvtnp}$-th digit in this sequence occurs in the part of the sequence in which the $hjgrksla$-digit numbers are placed, define $vbnxclqw(qzxwvtnp)$ to be $hjgrksla$. For example, $vbnxclqw(2)=2$ because the 100th digit enters the sequence in the placement of the two-digit integer 55. Find, with proof, $vbnxclqw(1987)$.",
      "solution": "Solution. Let \\( rtyuipas(hjgrksla) \\) denote the total number of digits in the integers with \\( hjgrksla \\) or fewer digits. Then \\( vbnxclqw(qzxwvtnp) \\) equals the integer \\( hjgrksla \\) such that \\( rtyuipas(hjgrksla-1)<10^{qzxwvtnp} \\leq rtyuipas(hjgrksla) \\).\n\nThere are \\( 10^{mnbvcxzq}-10^{mnbvcxzq-1} \\) numbers with exactly \\( mnbvcxzq \\) digits, so \\( rtyuipas(hjgrksla)=\\sum_{mnbvcxzq=1}^{hjgrksla} mnbvcxzq\\left(10^{mnbvcxzq}-10^{mnbvcxzq-1}\\right) \\). We have\n\\[\nrtyuipas(1983) \\leq \\sum_{mnbvcxzq=1}^{1983} 1983\\left(10^{mnbvcxzq}-10^{mnbvcxzq-1}\\right) \\leq 1983 \\cdot 10^{1983}<10^{1987}\n\\]\nand\n\\[\nrtyuipas(1984) \\geq 1984\\left(10^{1984}-10^{1983}\\right)=1984 \\cdot 9 \\cdot 10^{1983}>10^{4} \\cdot 10^{1983}=10^{1987}\n\\]\nso \\( vbnxclqw(1987)=1984 \\).\n\nMotivation. Based on the growth of geometric series one might guess that \\( rtyuipas(hjgrksla) \\) has size roughly equal to its top term, which is \\( 9 \\cdot hjgrksla \\cdot 10^{hjgrksla-1} \\). Thus we seek \\( hjgrksla \\) such that \\( 9 \\cdot hjgrksla \\cdot 10^{hjgrksla-1} \\approx 10^{1987} \\). Using \\( 9 \\approx 10 \\), the condition becomes \\( hjgrksla \\approx 10^{1987-hjgrksla} \\). This leads to the guess \\( hjgrksla=1984 \\), since \\( 1984 \\approx 10^{3} \\).\n\nRemark. There is a closed form for \\( rtyuipas(hjgrksla) \\) :\n\\[\n\\begin{aligned}\nrtyuipas(hjgrksla) & =\\sum_{mnbvcxzq=1}^{hjgrksla} mnbvcxzq 10^{mnbvcxzq}-\\sum_{mnbvcxzq=1}^{hjgrksla} mnbvcxzq 10^{mnbvcxzq-1} \\\\\n& =\\sum_{mnbvcxzq=1}^{hjgrksla} mnbvcxzq 10^{mnbvcxzq}-\\sum_{plmoknij=0}^{hjgrksla-1}(plmoknij+1) 10^{plmoknij} \\\\\n& =\\left(hjgrksla 10^{hjgrksla}+\\sum_{mnbvcxzq=0}^{hjgrksla-1} mnbvcxzq 10^{mnbvcxzq}\\right)-\\sum_{plmoknij=0}^{hjgrksla-1}(plmoknij+1) 10^{plmoknij} \\\\\n& =hjgrksla 10^{hjgrksla}-\\sum_{plmoknij=0}^{hjgrksla-1} 10^{plmoknij} \\\\\n& =hjgrksla 10^{hjgrksla}-\\left(10^{hjgrksla}-1\\right) / 9\n\\end{aligned}\n\\]\n\nMore generally, there is a closed form for \\( \\sum_{mnbvcxzq=zlkjhgfq}^{poiuytre} qazwsxed(mnbvcxzq) wsxcvbnm^{mnbvcxzq} \\) for any integers \\( zlkjhgfq \\leq poiuytre \\), fixed polynomial \\( qazwsxed \\), and number \\( wsxcvbnm \\). Rearrangement as above shows that\n\\[\n(1-wsxcvbnm) \\sum_{mnbvcxzq=zlkjhgfq}^{poiuytre} qazwsxed(mnbvcxzq) wsxcvbnm^{mnbvcxzq}=qazwsxed(zlkjhgfq) wsxcvbnm^{zlkjhgfq}-qazwsxed(poiuytre) wsxcvbnm^{poiuytre+1}+\\sum_{mnbvcxzq=zlkjhgfq+1}^{poiuytre}(qazwsxed(mnbvcxzq)-qazwsxed(mnbvcxzq-1)) wsxcvbnm^{mnbvcxzq}\n\\]\nand the last sum is of the same type but with a polynomial \\( qazwsxed(mnbvcxzq)-qazwsxed(mnbvcxzq-1) \\) of lower degree than \\( qazwsxed \\), or zero if \\( qazwsxed \\) was constant to begin with. Hence one can evaluate the sum by induction on \\( \\operatorname{deg} qazwsxed \\).\n\nAlternatively, \\( \\sum_{mnbvcxzq=zlkjhgfq}^{poiuytre} qazwsxed(mnbvcxzq) wsxcvbnm^{mnbvcxzq} \\) can be evaluated by repeatedly differentiating the formula for the geometric series\n\\[\n\\sum_{mnbvcxzq=zlkjhgfq}^{poiuytre} wsxcvbnm^{mnbvcxzq}=\\frac{wsxcvbnm^{poiuytre+1}-wsxcvbnm^{zlkjhgfq}}{wsxcvbnm-1}\n\\]\nand taking linear combinations of the resulting identities."
    },
    "kernel_variant": {
      "question": "Let $\\mathcal{A}$ be the set of positive integers whose base–$9$ expansion  \n\n1. never uses the digits $0$ or $8$ (so every digit lies in $\\{1,2,3,4,5,6,7\\}$);  \n2. has digit–sum divisible by $3$.  \n\nWrite the elements of $\\mathcal{A}$ in increasing order and concatenate their base–$9$ representations, without separators, obtaining the infinite base–$9$ digit string  \n\n\\[\n3\\;6\\;1\\;2\\;1\\;5\\;2\\;1\\;2\\;4\\;2\\;7\\;3\\;3\\;3\\;6\\;4\\;2\\;4\\;5\\;\\dots\n\\]\n\n(The one–digit admissible numbers are $3_9$ and $6_9$; the first two–digit ones are  \n$12_9,15_9,21_9,24_9,27_9,33_9,36_9,\\dots$.)\n\nFor a non–negative integer $n$ let $f(n)=m$ when the $9^{\\,n}$-th digit of this string is found while writing an $m$-digit number.  Determine $f(1234)$.",
      "solution": "We solve the problem under the precise rules stated above (digits $\\{1,\\dots ,7\\}$, digit–sum $0\\bmod 3$).\n\n1.  Counting admissible $k$-digit numbers  \n   ------------------------------------------------  \n   In base $9$ the allowed digits split according to residue class mod $3$:\n\n   \\[\n   c_{0}=2 \\; (3,6),\\qquad\n   c_{1}=3 \\; (1,4,7),\\qquad\n   c_{2}=2 \\; (2,5).\n   \\]\n\n   Let $N_k$ be the number of admissible $k$-digit words.  \n   By the root–of–unity filter with $\\omega = e^{2\\pi i/3}$,\n\n   \\[\n   N_k \\;=\\;\n   \\frac{1}{3}\\sum_{j=0}^{2}(c_{0}+c_{1}\\omega^{j}+c_{2}\\omega^{2j})^{\\,k}.\n   \\tag{1}\n   \\]\n\n   As $c_{0}+c_{1}+c_{2}=7$, put  \n\n   \\[\n   S_{j}:=c_{0}+c_{1}\\omega^{j}+c_{2}\\omega^{2j},\\qquad\n   S_{0}=7,\\; S_{1}=2+3\\omega+2\\omega^{2},\\; S_{2}=\\overline{S_{1}}.\n   \\]\n\n   One checks $|S_{1}|=|S_{2}|=1$.  Hence  \n\n   \\[\n   N_k =\\frac{7^{k}+2\\operatorname{Re}(S_{1}^{\\,k})}{3},\n   \\tag{2}\n   \\]\n   giving the uniform bounds  \n\n   \\[\n   \\frac{7^{k}-2}{3}\\;\\le\\;N_k\\;\\le\\;\\frac{7^{k}+2}{3}.\n   \\tag{3}\n   \\]\n\n2.  Total digits written up to and including length $m$  \n   ----------------------------------------------------  \n   Let  \n\n   \\[\n   G(m):=\\sum_{k=1}^{m} k\\,N_k,\n   \\]\n\n   the number of digits written before the first $(m+1)$-digit admissible number begins.  \n   From (3),\n\n   \\[\n   \\frac{1}{3}\\sum_{k=1}^{m}k(7^{k}-2)\n   \\;\\le\\;\n   G(m)\n   \\;\\le\\;\n   \\frac{1}{3}\\sum_{k=1}^{m}k(7^{k}+2).\n   \\tag{4}\n   \\]\n\n   The contribution of the constant $\\pm 2$ is at most $m(m+1)/3$, so\n\n   \\[\n   \\bigl(\\tfrac13\\bigr)\\!\\sum_{k=1}^{m}k7^{k}-m^{2}\n   \\;\\le\\;\n   G(m)\n   \\;\\le\\;\n   \\bigl(\\tfrac13\\bigr)\\!\\sum_{k=1}^{m}k7^{k}+m^{2}.\n   \\tag{5}\n   \\]\n\n3.  Estimating the geometric sum  \n   ------------------------------  \n   Put  \n\n   \\[\n   S_m:=\\sum_{k=1}^{m}k7^{k}.\n   \\]\n\n   Because consecutive terms grow by a factor nearly $7$,\n\n   \\[\n   m7^{m}\\;<\\;S_m\\;<\\;\\frac{m7^{m+1}}{6}.\n   \\tag{6}\n   \\]\n\n   Combining (5) and (6) yields, for every $m\\ge 2$,\n\n   \\[\n   \\boxed{\\;\n   \\frac{m7^{m}}{3}-m^{2}\\;\n   <\\;\n   G(m)\n   \\;\n   <\\;\n   \\frac{7m7^{m}}{18}+m^{2}\n   \\;}\n   \\tag{7}\n   \\]\n\n   Thus $G(m)$ behaves like $\\bigl(\\tfrac{m}{3}\\bigr)7^{m}$ up to a negligible polynomial error.\n\n4.  Locating the $9^{\\,1234}$-th digit  \n   ------------------------------------  \n   We seek the unique $m$ with  \n\n   \\[\n   G(m-1) \\;<\\; 9^{1234}\\;\\le\\; G(m).\n   \\]\n\n   Write  \n   \\[\n   T:=1234\\ln 9,\\qquad\\ln 9=2.197224576,\\qquad\\ln 7=1.945910149.\n   \\]\n\n   Using the main term $\\ln\\!\\bigl( (m/3)7^{m}\\bigr)=\\ln m-\\ln 3+m\\ln 7$,\n   a first approximation gives  \n\n   \\[\n   m_{0}:=\\frac{T}{\\ln 7}\\approx\n   \\frac{1234\\cdot 2.19722}{1.94591}\\approx 1393.3.\n   \\]\n\n   Moving one unit in $m$ changes the main term by roughly $\\ln 7\\approx 1.946$.  \n   Evaluating it at neighboring integers:\n\n   \\[\n   \\begin{aligned}\n   m=1390:&\\quad \\ln\\!\\bigl((m/3)7^{m}\\bigr)\\approx 2710.934\\;<\\;T,\\\\\n   m=1391:&\\quad \\ln\\!\\bigl((m/3)7^{m}\\bigr)\\approx 2712.900\\;>\\;T.\n   \\end{aligned}\n   \\]\n\n   The gap between these two logarithms is about $1.966$, i.e.\\ a factor of almost\n   $e^{1.966}\\approx 7.14$ in the numbers themselves, whereas the polynomial error\n   term $m^{2}$ in (7) is below $2\\times 10^{6}$ and hence utterly negligible\n   at this scale.\n\n   Using (7) we therefore still have\n\n   \\[\n   G(1390) < 9^{1234} < G(1391).\n   \\]\n\n   Consequently the $9^{\\,1234}$-th digit first appears while we are writing a\n   $1391$-digit admissible number, so\n\n   \\[\n   \\boxed{\\,f(1234)=1391\\,}.\n   \\]\n\n   $\\square$",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T19:09:31.696885",
        "was_fixed": false,
        "difficulty_analysis": "• Additional combinatorial constraint (digit-sum ≡ 0 (mod 3)) means the allowed numbers are no longer a simple geometric family; the exact count requires a root-of-unity filter or eigen-value analysis.  \n• The eigenvalues S₁, S₂ have modulus 1, so an error term of size O(1) survives in Nₖ; the solution must show this term is dominated by the huge main term when n = 1234.  \n• Determining G(m) now needs careful two-sided estimates that keep track simultaneously of the leading exponential ~ (1/3)m7^{m} and the oscillatory error; a single comparison with m7^{m} is no longer enough.  \n• The proof mixes techniques from combinatorial enumeration (Fourier filter), analytic estimation of exponential sums, and asymptotic comparison, going well beyond the elementary geometric-series arguments that solve the original problem."
      }
    },
    "original_kernel_variant": {
      "question": "Let $\\mathcal{A}$ be the set of positive integers whose base–$9$ expansion  \n\n1. never uses the digits $0$ or $8$ (so every digit lies in $\\{1,2,3,4,5,6,7\\}$);  \n2. has digit–sum divisible by $3$.  \n\nWrite the elements of $\\mathcal{A}$ in increasing order and concatenate their base–$9$ representations, without separators, obtaining the infinite base–$9$ digit string  \n\n\\[\n3\\;6\\;1\\;2\\;1\\;5\\;2\\;1\\;2\\;4\\;2\\;7\\;3\\;3\\;3\\;6\\;4\\;2\\;4\\;5\\;\\dots\n\\]\n\n(The one–digit admissible numbers are $3_9$ and $6_9$; the first two–digit ones are  \n$12_9,15_9,21_9,24_9,27_9,33_9,36_9,\\dots$.)\n\nFor a non–negative integer $n$ let $f(n)=m$ when the $9^{\\,n}$-th digit of this string is found while writing an $m$-digit number.  Determine $f(1234)$.",
      "solution": "We solve the problem under the precise rules stated above (digits $\\{1,\\dots ,7\\}$, digit–sum $0\\bmod 3$).\n\n1.  Counting admissible $k$-digit numbers  \n   ------------------------------------------------  \n   In base $9$ the allowed digits split according to residue class mod $3$:\n\n   \\[\n   c_{0}=2 \\; (3,6),\\qquad\n   c_{1}=3 \\; (1,4,7),\\qquad\n   c_{2}=2 \\; (2,5).\n   \\]\n\n   Let $N_k$ be the number of admissible $k$-digit words.  \n   By the root–of–unity filter with $\\omega = e^{2\\pi i/3}$,\n\n   \\[\n   N_k \\;=\\;\n   \\frac{1}{3}\\sum_{j=0}^{2}(c_{0}+c_{1}\\omega^{j}+c_{2}\\omega^{2j})^{\\,k}.\n   \\tag{1}\n   \\]\n\n   As $c_{0}+c_{1}+c_{2}=7$, put  \n\n   \\[\n   S_{j}:=c_{0}+c_{1}\\omega^{j}+c_{2}\\omega^{2j},\\qquad\n   S_{0}=7,\\; S_{1}=2+3\\omega+2\\omega^{2},\\; S_{2}=\\overline{S_{1}}.\n   \\]\n\n   One checks $|S_{1}|=|S_{2}|=1$.  Hence  \n\n   \\[\n   N_k =\\frac{7^{k}+2\\operatorname{Re}(S_{1}^{\\,k})}{3},\n   \\tag{2}\n   \\]\n   giving the uniform bounds  \n\n   \\[\n   \\frac{7^{k}-2}{3}\\;\\le\\;N_k\\;\\le\\;\\frac{7^{k}+2}{3}.\n   \\tag{3}\n   \\]\n\n2.  Total digits written up to and including length $m$  \n   ----------------------------------------------------  \n   Let  \n\n   \\[\n   G(m):=\\sum_{k=1}^{m} k\\,N_k,\n   \\]\n\n   the number of digits written before the first $(m+1)$-digit admissible number begins.  \n   From (3),\n\n   \\[\n   \\frac{1}{3}\\sum_{k=1}^{m}k(7^{k}-2)\n   \\;\\le\\;\n   G(m)\n   \\;\\le\\;\n   \\frac{1}{3}\\sum_{k=1}^{m}k(7^{k}+2).\n   \\tag{4}\n   \\]\n\n   The contribution of the constant $\\pm 2$ is at most $m(m+1)/3$, so\n\n   \\[\n   \\bigl(\\tfrac13\\bigr)\\!\\sum_{k=1}^{m}k7^{k}-m^{2}\n   \\;\\le\\;\n   G(m)\n   \\;\\le\\;\n   \\bigl(\\tfrac13\\bigr)\\!\\sum_{k=1}^{m}k7^{k}+m^{2}.\n   \\tag{5}\n   \\]\n\n3.  Estimating the geometric sum  \n   ------------------------------  \n   Put  \n\n   \\[\n   S_m:=\\sum_{k=1}^{m}k7^{k}.\n   \\]\n\n   Because consecutive terms grow by a factor nearly $7$,\n\n   \\[\n   m7^{m}\\;<\\;S_m\\;<\\;\\frac{m7^{m+1}}{6}.\n   \\tag{6}\n   \\]\n\n   Combining (5) and (6) yields, for every $m\\ge 2$,\n\n   \\[\n   \\boxed{\\;\n   \\frac{m7^{m}}{3}-m^{2}\\;\n   <\\;\n   G(m)\n   \\;\n   <\\;\n   \\frac{7m7^{m}}{18}+m^{2}\n   \\;}\n   \\tag{7}\n   \\]\n\n   Thus $G(m)$ behaves like $\\bigl(\\tfrac{m}{3}\\bigr)7^{m}$ up to a negligible polynomial error.\n\n4.  Locating the $9^{\\,1234}$-th digit  \n   ------------------------------------  \n   We seek the unique $m$ with  \n\n   \\[\n   G(m-1) \\;<\\; 9^{1234}\\;\\le\\; G(m).\n   \\]\n\n   Write  \n   \\[\n   T:=1234\\ln 9,\\qquad\\ln 9=2.197224576,\\qquad\\ln 7=1.945910149.\n   \\]\n\n   Using the main term $\\ln\\!\\bigl( (m/3)7^{m}\\bigr)=\\ln m-\\ln 3+m\\ln 7$,\n   a first approximation gives  \n\n   \\[\n   m_{0}:=\\frac{T}{\\ln 7}\\approx\n   \\frac{1234\\cdot 2.19722}{1.94591}\\approx 1393.3.\n   \\]\n\n   Moving one unit in $m$ changes the main term by roughly $\\ln 7\\approx 1.946$.  \n   Evaluating it at neighboring integers:\n\n   \\[\n   \\begin{aligned}\n   m=1390:&\\quad \\ln\\!\\bigl((m/3)7^{m}\\bigr)\\approx 2710.934\\;<\\;T,\\\\\n   m=1391:&\\quad \\ln\\!\\bigl((m/3)7^{m}\\bigr)\\approx 2712.900\\;>\\;T.\n   \\end{aligned}\n   \\]\n\n   The gap between these two logarithms is about $1.966$, i.e.\\ a factor of almost\n   $e^{1.966}\\approx 7.14$ in the numbers themselves, whereas the polynomial error\n   term $m^{2}$ in (7) is below $2\\times 10^{6}$ and hence utterly negligible\n   at this scale.\n\n   Using (7) we therefore still have\n\n   \\[\n   G(1390) < 9^{1234} < G(1391).\n   \\]\n\n   Consequently the $9^{\\,1234}$-th digit first appears while we are writing a\n   $1391$-digit admissible number, so\n\n   \\[\n   \\boxed{\\,f(1234)=1391\\,}.\n   \\]\n\n   $\\square$",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T01:37:45.544760",
        "was_fixed": false,
        "difficulty_analysis": "• Additional combinatorial constraint (digit-sum ≡ 0 (mod 3)) means the allowed numbers are no longer a simple geometric family; the exact count requires a root-of-unity filter or eigen-value analysis.  \n• The eigenvalues S₁, S₂ have modulus 1, so an error term of size O(1) survives in Nₖ; the solution must show this term is dominated by the huge main term when n = 1234.  \n• Determining G(m) now needs careful two-sided estimates that keep track simultaneously of the leading exponential ~ (1/3)m7^{m} and the oscillatory error; a single comparison with m7^{m} is no longer enough.  \n• The proof mixes techniques from combinatorial enumeration (Fourier filter), analytic estimation of exponential sums, and asymptotic comparison, going well beyond the elementary geometric-series arguments that solve the original problem."
      }
    }
  },
  "checked": true,
  "problem_type": "proof"
}