{
  "index": "2015-B-2",
  "type": "NT",
  "tag": [
    "NT",
    "COMB"
  ],
  "difficulty": "",
  "question": "Given a list of the positive integers $1,2,3,4,\\dots$, take the first three numbers\n$1,2,3$ and their sum $6$ and cross all four numbers off the list. Repeat with the three \nsmallest remaining numbers $4,5,7$ and their sum $16$. Continue in this way, crossing off the three smallest remaining numbers and their sum, and consider the sequence of sums produced: $6, 16, 27, 36, \\dots$. Prove or disprove that there is some number in the sequence whose base 10 representation ends with $2015$.\n\n\\,",
  "solution": "We will prove that 42015 is such a number in the sequence.\nLabel the sequence of sums $s_0, s_1, \\dots$, and let $a_n, b_n, c_n$ be the summands of $s_n$ in ascending order. We prove the following two statements for each nonnegative integer $n$: \\begin{enumerate}\n\\item[(a)$_n$]\nThe sequence\n\\[\na_{3n}, b_{3n}, c_{3n}, a_{3n+1}, b_{3n+1}, c_{3n+1},\na_{3n+2}, b_{3n+2}, c_{3n+2}\n\\]\nis obtained from the sequence $10n+1, \\dots, 10n+10$ by removing one of $10n+5, 10n+6, 10n+7$.\n\\item[(b)$_n$]\nWe have\n\\begin{align*}\ns_{3n} &= 30n+6,\\\\\ns_{3n+1} &\\in \\{30n+15, 30n+16, 30n+17\\}, \\\\\ns_{3n+2} &= 30n+27.\n\\end{align*}\n\\end{enumerate}\nThese statements follow by induction from the following simple observations:\n\\begin{itemize}\n\\item\nby computing the table of values\n\\[\n\\begin{array}{c|cccc}\nn & a_n & b_n & c_n & s_n \\\\\n\\hline\n 0 &  1 &  2 &  3 &  6 \\\\\n 1 &  4 &  5 &  7 & 16 \\\\\n 2 &  8 &  9 & 10 & 27\n\\end{array}\n\\]\nwe see that (a)$_0$ holds;\n\\item\n(a)$_n$ implies (b)$_n$;\n\\item\n(a)$_n$ and (b)$_1$, \\dots, (b)$_n$ together imply (a)$_{n+1}$.\n\\end{itemize}\nTo produce a value of $n$ for which $s_n \\equiv 2015 \\pmod{10000}$, we take $n = 3m+1$ for some nonnegative integer $m$ for which $s_{3m+1} = 30m+15$. We must also have $30m \\equiv 2000 \\pmod{10000}$, or equivalently $m \\equiv 400 \\pmod{1000}$.\nBy taking $m = 1400$, we ensure that $m \\equiv 2 \\pmod{3}$, so $s_m = 10m + 7$; this ensures that $s_{n}$ does indeed equal $30m+15 = 42015$, as desired.\n\n\\noindent\n\\textbf{Remark:}\nWith a bit more work, we can give a complete description of $s_n$, and in particular find the first term in the sequence whose decimal expansion ends in 2015.\nDefine the function on nonnegative integers\n\\[\nf(n) = s_{3n+1} - (30n + 16)\n\\]\nwhich takes values in $\\{-1, 0, 1\\}$; we then have\n\\[\nf(n) = \\begin{cases} 0 & n \\equiv 0 \\pmod{3} \\\\\n-f((n-1)/3) & n \\equiv 1 \\pmod{3} \\\\\n-1 & n \\equiv 2 \\pmod{3}.\n\\end{cases}\n\\]\nConsequently, if we write $n$ in base 3, then $f(n) = 0$ unless the expansion ends with 2 followed by a string of 1s of length $k \\geq 0$, in which case $f(n) = (-1)^{k+1}$.\n\nIn this notation, we have $s_n \\equiv 2015 \\pmod{10000}$ if and only if $n = 3m+1$\nfor some nonnegative integer $m$ for which\n$m \\equiv 400 \\pmod{1000}$ and $f(m) = -1$.\nSince $400 = 112211_{(3)}$, the first such term in the sequence is in fact $s_{1201} = 12015$.",
  "vars": [
    "s_n",
    "a_n",
    "b_n",
    "c_n",
    "f",
    "n",
    "m",
    "k"
  ],
  "params": [],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "s_n": "sumseq",
        "a_n": "firstsummand",
        "b_n": "secondsummand",
        "c_n": "thirdsummand",
        "f": "modfunc",
        "n": "indexvar",
        "m": "auxindex",
        "k": "onescount"
      },
      "question": "Given a list of the positive integers $1,2,3,4,\\dots$, take the first three numbers\n$1,2,3$ and their sum $6$ and cross all four numbers off the list. Repeat with the three \nsmallest remaining numbers $4,5,7$ and their sum $16$. Continue in this way, crossing off the three smallest remaining numbers and their sum, and consider the sequence of sums produced: $6, 16, 27, 36, \\dots$. Prove or disprove that there is some number in the sequence whose base 10 representation ends with $2015$.\n",
      "solution": "We will prove that 42015 is such a number in the sequence.\nLabel the sequence of sums $sumseq_0, sumseq_1, \\dots$, and let $firstsummand_{indexvar}, secondsummand_{indexvar}, thirdsummand_{indexvar}$ be the summands of $sumseq_{indexvar}$ in ascending order. We prove the following two statements for each nonnegative integer $indexvar$:\n\\begin{enumerate}\n\\item[(a)$_{indexvar}$]\nThe sequence\n\\[\nfirstsummand_{3indexvar}, secondsummand_{3indexvar}, thirdsummand_{3indexvar}, firstsummand_{3indexvar+1}, secondsummand_{3indexvar+1}, thirdsummand_{3indexvar+1},\nfirstsummand_{3indexvar+2}, secondsummand_{3indexvar+2}, thirdsummand_{3indexvar+2}\n\\]\nis obtained from the sequence $10indexvar+1, \\dots, 10indexvar+10$ by removing one of $10indexvar+5, 10indexvar+6, 10indexvar+7$.\n\\item[(b)$_{indexvar}$]\nWe have\n\\begin{align*}\nsumseq_{3indexvar} &= 30indexvar+6,\\\\\nsumseq_{3indexvar+1} &\\in \\{30indexvar+15, 30indexvar+16, 30indexvar+17\\}, \\\\\nsumseq_{3indexvar+2} &= 30indexvar+27.\n\\end{align*}\n\\end{enumerate}\nThese statements follow by induction from the following simple observations:\n\\begin{itemize}\n\\item by computing the table of values\n\\[\n\\begin{array}{c|cccc}\nindexvar & firstsummand_{indexvar} & secondsummand_{indexvar} & thirdsummand_{indexvar} & sumseq_{indexvar} \\\\\n\\hline\n 0 &  1 &  2 &  3 &  6 \\\\\n 1 &  4 &  5 &  7 & 16 \\\\\n 2 &  8 &  9 & 10 & 27\n\\end{array}\n\\]\nwe see that (a)$_0$ holds;\n\\item (a)$_{indexvar}$ implies (b)$_{indexvar}$;\n\\item (a)$_{indexvar}$ and (b)$_1$, \\dots, (b)$_{indexvar}$ together imply (a)$_{indexvar+1}$.\n\\end{itemize}\nTo produce a value of $indexvar$ for which $sumseq_{indexvar} \\equiv 2015 \\pmod{10000}$, we take $indexvar = 3auxindex+1$ for some nonnegative integer $auxindex$ for which $sumseq_{3auxindex+1} = 30auxindex+15$. We must also have $30auxindex \\equiv 2000 \\pmod{10000}$, or equivalently $auxindex \\equiv 400 \\pmod{1000}$.\nBy taking $auxindex = 1400$, we ensure that $auxindex \\equiv 2 \\pmod{3}$, so $sumseq_{auxindex} = 10auxindex + 7$; this ensures that $sumseq_{indexvar}$ does indeed equal $30auxindex+15 = 42015$, as desired.\n\n\\noindent\\textbf{Remark:} With a bit more work, we can give a complete description of $sumseq_{indexvar}$, and in particular find the first term in the sequence whose decimal expansion ends in 2015.\nDefine the function on nonnegative integers\n\\[\nmodfunc(indexvar) = sumseq_{3indexvar+1} - (30indexvar + 16)\n\\]\nwhich takes values in $\\{-1,0,1\\}$; we then have\n\\[\nmodfunc(indexvar)=\\begin{cases}0 & indexvar \\equiv 0 \\pmod{3}\\\\-\\,modfunc((indexvar-1)/3) & indexvar \\equiv 1 \\pmod{3}\\\\-1 & indexvar \\equiv 2 \\pmod{3}.\\end{cases}\n\\]\nConsequently, if we write $indexvar$ in base 3, then $modfunc(indexvar)=0$ unless the expansion ends with 2 followed by a string of 1s of length $onescount \\ge 0$, in which case $modfunc(indexvar)=(-1)^{onescount+1}$.\n\nIn this notation, we have $sumseq_{indexvar} \\equiv 2015 \\pmod{10000}$ iff $indexvar = 3auxindex+1$ for some nonnegative integer $auxindex$ with $auxindex \\equiv 400 \\pmod{1000}$ and $modfunc(auxindex)=-1$. Since $400 = 112211_{(3)}$, the first such term in the sequence is in fact $sumseq_{1201}=12015$.\n"
    },
    "descriptive_long_confusing": {
      "map": {
        "s_n": "blackboard",
        "a_n": "pineapple",
        "b_n": "jellyfish",
        "c_n": "arrowhead",
        "f": "tangerine",
        "n": "rainstorm",
        "m": "lighthouse",
        "k": "blueberry"
      },
      "question": "Given a list of the positive integers $1,2,3,4,\\dots$, take the first three numbers\n$1,2,3$ and their sum $6$ and cross all four numbers off the list. Repeat with the three \nsmallest remaining numbers $4,5,7$ and their sum $16$. Continue in this way, crossing off the three smallest remaining numbers and their sum, and consider the sequence of sums produced: $6, 16, 27, 36, \\dots$. Prove or disprove that there is some number in the sequence whose base 10 representation ends with $2015$.",
      "solution": "We will prove that 42015 is such a number in the sequence.\nLabel the sequence of sums $blackboard_0, blackboard_1, \\dots$, and let $pineapple_{rainstorm}, jellyfish_{rainstorm}, arrowhead_{rainstorm}$ be the summands of $blackboard_{rainstorm}$ in ascending order. We prove the following two statements for each nonnegative integer $rainstorm$: \n\\begin{enumerate}\n\\item[(a)$_{rainstorm}$]\nThe sequence\n\\[\npineapple_{3rainstorm}, jellyfish_{3rainstorm}, arrowhead_{3rainstorm}, \\pineapple_{3rainstorm+1}, jellyfish_{3rainstorm+1}, arrowhead_{3rainstorm+1},\n\\pineapple_{3rainstorm+2}, jellyfish_{3rainstorm+2}, arrowhead_{3rainstorm+2}\n\\]\nis obtained from the sequence $10rainstorm+1, \\dots, 10rainstorm+10$ by removing one of $10rainstorm+5, 10rainstorm+6, 10rainstorm+7$.\n\\item[(b)$_{rainstorm}$]\nWe have\n\\begin{align*}\nblackboard_{3rainstorm} &= 30rainstorm+6,\\\\\nblackboard_{3rainstorm+1} &\\in \\{30rainstorm+15, 30rainstorm+16, 30rainstorm+17\\}, \\\\\nblackboard_{3rainstorm+2} &= 30rainstorm+27.\n\\end{align*}\n\\end{enumerate}\nThese statements follow by induction from the following simple observations:\n\\begin{itemize}\n\\item\nby computing the table of values\n\\[\n\\begin{array}{c|cccc}\nrainstorm & pineapple_{rainstorm} & jellyfish_{rainstorm} & arrowhead_{rainstorm} & blackboard_{rainstorm} \\\\\n\\hline\n 0 &  1 &  2 &  3 &  6 \\\\\n 1 &  4 &  5 &  7 & 16 \\\\\n 2 &  8 &  9 & 10 & 27\n\\end{array}\n\\]\nwe see that (a)$_0$ holds;\n\\item\n(a)$_{rainstorm}$ implies (b)$_{rainstorm}$;\n\\item\n(a)$_{rainstorm}$ and (b)$_1$, \\dots, (b)$_{rainstorm}$ together imply (a)$_{rainstorm+1}$.\n\\end{itemize}\nTo produce a value of $rainstorm$ for which $blackboard_{rainstorm} \\equiv 2015 \\pmod{10000}$, we take $rainstorm = 3lighthouse+1$ for some nonnegative integer $lighthouse$ for which $blackboard_{3lighthouse+1} = 30lighthouse+15$. We must also have $30lighthouse \\equiv 2000 \\pmod{10000}$, or equivalently $lighthouse \\equiv 400 \\pmod{1000}$.\nBy taking $lighthouse = 1400$, we ensure that $lighthouse \\equiv 2 \\pmod{3}$, so $blackboard_{lighthouse} = 10lighthouse + 7$; this ensures that $blackboard_{rainstorm}$ does indeed equal $30lighthouse+15 = 42015$, as desired.\n\n\\noindent\n\\textbf{Remark:}\nWith a bit more work, we can give a complete description of $blackboard_{rainstorm}$, and in particular find the first term in the sequence whose decimal expansion ends in 2015.\nDefine the function on nonnegative integers\n\\[\ntangerine(rainstorm) = blackboard_{3rainstorm+1} - (30rainstorm + 16)\n\\]\nwhich takes values in $\\{-1, 0, 1\\}$; we then have\n\\[\ntangerine(rainstorm) = \\begin{cases} 0 & rainstorm \\equiv 0 \\pmod{3} \\\\\n-\\,tangerine((rainstorm-1)/3) & rainstorm \\equiv 1 \\pmod{3} \\\\\n-1 & rainstorm \\equiv 2 \\pmod{3}.\n\\end{cases}\n\\]\nConsequently, if we write $rainstorm$ in base 3, then $tangerine(rainstorm) = 0$ unless the expansion ends with 2 followed by a string of 1s of length $blueberry \\geq 0$, in which case $tangerine(rainstorm) = (-1)^{blueberry+1}$.\n\nIn this notation, we have $blackboard_{rainstorm} \\equiv 2015 \\pmod{10000}$ if and only if $rainstorm = 3lighthouse+1$\nfor some nonnegative integer $lighthouse$ for which\n$lighthouse \\equiv 400 \\pmod{1000}$ and $tangerine(lighthouse) = -1$.\nSince $400 = 112211_{(3)}$, the first such term in the sequence is in fact $blackboard_{1201} = 12015$.",
      "solution_notes": ""
    },
    "descriptive_long_misleading": {
      "map": {
        "s_n": "differencevalue",
        "a_n": "largestpart",
        "b_n": "outerpart",
        "c_n": "smallestpart",
        "f": "constantvalue",
        "n": "fractional",
        "m": "irrational",
        "k": "shortness"
      },
      "question": "Given a list of the positive integers $1,2,3,4,\\dots$, take the first three numbers\n$1,2,3$ and their sum $6$ and cross all four numbers off the list. Repeat with the three \nsmallest remaining numbers $4,5,7$ and their sum $16$. Continue in this way, crossing off the three smallest remaining numbers and their sum, and consider the sequence of sums produced: $6, 16, 27, 36, \\dots$. Prove or disprove that there is some number in the sequence whose base 10 representation ends with $2015$.",
      "solution": "We will prove that 42015 is such a number in the sequence.\nLabel the sequence of sums $differencevalue_0, differencevalue_1, \\dots$, and let $largestpart_{fractional}, outerpart_{fractional}, smallestpart_{fractional}$ be the summands of $differencevalue_{fractional}$ in ascending order. We prove the following two statements for each nonnegative integer $fractional$: \\begin{enumerate}\n\\item[(a)$_{fractional}$]\nThe sequence\n\\[\nlargestpart_{3\\fractional}, outerpart_{3\\fractional}, smallestpart_{3\\fractional}, largestpart_{3\\fractional+1}, outerpart_{3\\fractional+1}, smallestpart_{3\\fractional+1},\nlargestpart_{3\\fractional+2}, outerpart_{3\\fractional+2}, smallestpart_{3\\fractional+2}\n\\]\nis obtained from the sequence $10\\fractional+1, \\dots, 10\\fractional+10$ by removing one of $10\\fractional+5, 10\\fractional+6, 10\\fractional+7$.\n\\item[(b)$_{fractional}$]\nWe have\n\\begin{align*}\ndifferencevalue_{3\\fractional} &= 30\\fractional+6,\\\\\ndifferencevalue_{3\\fractional+1} &\\in \\{30\\fractional+15, 30\\fractional+16, 30\\fractional+17\\}, \\\\\ndifferencevalue_{3\\fractional+2} &= 30\\fractional+27.\n\\end{align*}\n\\end{enumerate}\nThese statements follow by induction from the following simple observations:\n\\begin{itemize}\n\\item\nby computing the table of values\n\\[\n\\begin{array}{c|cccc}\nfractional & largestpart_{fractional} & outerpart_{fractional} & smallestpart_{fractional} & differencevalue_{fractional} \\\\\n\\hline\n 0 &  1 &  2 &  3 &  6 \\\\\n 1 &  4 &  5 &  7 & 16 \\\\\n 2 &  8 &  9 & 10 & 27\n\\end{array}\n\\]\nwe see that (a)$_0$ holds;\n\\item\n(a)$_{fractional}$ implies (b)$_{fractional}$;\n\\item\n(a)$_{fractional}$ and (b)$_1$, \\dots, (b)$_{fractional}$ together imply (a)$_{fractional+1}$.\n\\end{itemize}\nTo produce a value of $fractional$ for which $differencevalue_{fractional} \\equiv 2015 \\pmod{10000}$, we take $fractional = 3\\irrational+1$ for some nonnegative integer $\\irrational$ for which $differencevalue_{3\\irrational+1} = 30\\irrational+15$. We must also have $30\\irrational \\equiv 2000 \\pmod{10000}$, or equivalently $\\irrational \\equiv 400 \\pmod{1000}$.\nBy taking $\\irrational = 1400$, we ensure that $\\irrational \\equiv 2 \\pmod{3}$, so $differencevalue_{\\irrational} = 10\\irrational + 7$; this ensures that $differencevalue_{fractional}$ does indeed equal $30\\irrational+15 = 42015$, as desired.\n\n\\noindent\n\\textbf{Remark:}\nWith a bit more work, we can give a complete description of $differencevalue_{fractional}$, and in particular find the first term in the sequence whose decimal expansion ends in 2015.\nDefine the function on nonnegative integers\n\\[\nconstantvalue(fractional) = differencevalue_{3fractional+1} - (30fractional + 16)\n\\]\nwhich takes values in $\\{-1, 0, 1\\}$; we then have\n\\[\nconstantvalue(fractional) = \\begin{cases} 0 & fractional \\equiv 0 \\pmod{3} \\\\ -constantvalue((fractional-1)/3) & fractional \\equiv 1 \\pmod{3} \\\\ -1 & fractional \\equiv 2 \\pmod{3}. \\end{cases}\n\\]\nConsequently, if we write $fractional$ in base 3, then $constantvalue(fractional) = 0$ unless the expansion ends with 2 followed by a string of 1s of length $shortness \\geq 0$, in which case $constantvalue(fractional) = (-1)^{shortness+1}$.\n\nIn this notation, we have $differencevalue_{fractional} \\equiv 2015 \\pmod{10000}$ if and only if $fractional = 3\\irrational+1$\nfor some nonnegative integer $\\irrational$ for which\n$\\irrational \\equiv 400 \\pmod{1000}$ and $constantvalue(\\irrational) = -1$.\nSince $400 = 112211_{(3)}$, the first such term in the sequence is in fact $differencevalue_{1201} = 12015$.",
      "params": []
    },
    "garbled_string": {
      "map": {
        "s_n": "qzxwvtnp",
        "a_n": "plwkojne",
        "b_n": "afygmntr",
        "c_n": "xzhqivsa",
        "f": "jdksalqp",
        "n": "pvztslry",
        "m": "zcvbmads",
        "k": "hgflpwei"
      },
      "question": "Given a list of the positive integers $1,2,3,4,\\dots$, take the first three numbers $1,2,3$ and their sum $6$ and cross all four numbers off the list. Repeat with the three smallest remaining numbers $4,5,7$ and their sum $16$. Continue in this way, crossing off the three smallest remaining numbers and their sum, and consider the sequence of sums produced: $6, 16, 27, 36, \\dots$. Prove or disprove that there is some number in the sequence whose base 10 representation ends with $2015$.",
      "solution": "We will prove that 42015 is such a number in the sequence.\nLabel the sequence of sums $qzxwvtnp_0, qzxwvtnp_1, \\dots$, and let $plwkojne_{pvztslry}, afygmntr_{pvztslry}, xzhqivsa_{pvztslry}$ be the summands of $qzxwvtnp_{pvztslry}$ in ascending order. We prove the following two statements for each nonnegative integer $pvztslry$:\n\\begin{enumerate}\n\\item[(a)$_{pvztslry}$]\nThe sequence\n\\[\nplwkojne_{3pvztslry}, afygmntr_{3pvztslry}, xzhqivsa_{3pvztslry}, plwkojne_{3pvztslry+1}, afygmntr_{3pvztslry+1}, xzhqivsa_{3pvztslry+1},\nplwkojne_{3pvztslry+2}, afygmntr_{3pvztslry+2}, xzhqivsa_{3pvztslry+2}\n\\]\nis obtained from the sequence $10pvztslry+1, \\dots, 10pvztslry+10$ by removing one of $10pvztslry+5, 10pvztslry+6, 10pvztslry+7$.\n\\item[(b)$_{pvztslry}$]\nWe have\n\\begin{align*}\nqzxwvtnp_{3pvztslry} &= 30pvztslry+6,\\\\\nqzxwvtnp_{3pvztslry+1} &\\in \\{30pvztslry+15, 30pvztslry+16, 30pvztslry+17\\}, \\\\\nqzxwvtnp_{3pvztslry+2} &= 30pvztslry+27.\n\\end{align*}\n\\end{enumerate}\nThese statements follow by induction from the following simple observations:\n\\begin{itemize}\n\\item\nby computing the table of values\n\\[\n\\begin{array}{c|cccc}\npvztslry & plwkojne_{pvztslry} & afygmntr_{pvztslry} & xzhqivsa_{pvztslry} & qzxwvtnp_{pvztslry} \\\\\\hline\n 0 &  1 &  2 &  3 &  6 \\\\\n 1 &  4 &  5 &  7 & 16 \\\\\n 2 &  8 &  9 & 10 & 27\n\\end{array}\n\\]\nwe see that (a)$_0$ holds;\n\\item\n(a)$_{pvztslry}$ implies (b)$_{pvztslry}$;\n\\item\n(a)$_{pvztslry}$ and (b)$_1$, \\dots, (b)$_{pvztslry}$ together imply (a)$_{pvztslry+1}$.\n\\end{itemize}\nTo produce a value of $pvztslry$ for which $qzxwvtnp_{pvztslry} \\equiv 2015 \\pmod{10000}$, we take $pvztslry = 3zcvbmads+1$ for some nonnegative integer $zcvbmads$ for which $qzxwvtnp_{3zcvbmads+1} = 30zcvbmads+15$. We must also have $30zcvbmads \\equiv 2000 \\pmod{10000}$, or equivalently $zcvbmads \\equiv 400 \\pmod{1000}$.\nBy taking $zcvbmads = 1400$, we ensure that $zcvbmads \\equiv 2 \\pmod{3}$, so $qzxwvtnp_{zcvbmads} = 10zcvbmads + 7$; this ensures that $qzxwvtnp_{pvztslry}$ does indeed equal $30zcvbmads+15 = 42015$, as desired.\n\n\\noindent\n\\textbf{Remark:}\nWith a bit more work, we can give a complete description of $qzxwvtnp_{pvztslry}$, and in particular find the first term in the sequence whose decimal expansion ends in 2015.\nDefine the function on nonnegative integers\n\\[\njdksalqp(pvztslry) = qzxwvtnp_{3pvztslry+1} - (30pvztslry + 16)\n\\]\nwhich takes values in $\\{-1, 0, 1\\}$; we then have\n\\[\njdksalqp(pvztslry) = \\begin{cases} 0 & pvztslry \\equiv 0 \\pmod{3} \\\\\n-jdksalqp((pvztslry-1)/3) & pvztslry \\equiv 1 \\pmod{3} \\\\\n-1 & pvztslry \\equiv 2 \\pmod{3}.\n\\end{cases}\n\\]\nConsequently, if we write $pvztslry$ in base 3, then $jdksalqp(pvztslry) = 0$ unless the expansion ends with 2 followed by a string of 1s of length $hgflpwei \\geq 0$, in which case $jdksalqp(pvztslry) = (-1)^{hgflpwei+1}$.\n\nIn this notation, we have $qzxwvtnp_{pvztslry} \\equiv 2015 \\pmod{10000}$ if and only if $pvztslry = 3zcvbmads+1$\nfor some nonnegative integer $zcvbmads$ for which\n$zcvbmads \\equiv 400 \\pmod{1000}$ and $jdksalqp(zcvbmads) = -1$.\nSince $400 = 112211_{(3)}$, the first such term in the sequence is in fact $qzxwvtnp_{1201} = 12015$.",
      "params": []
    },
    "kernel_variant": {
      "question": "Let $(s_n)_{n\\ge 0}$ be defined as follows.  Start with the ordered list of positive integers\n$$1,2,3,4,\\dots .$$\nRepeatedly perform the two actions\n • cross out the three smallest numbers that have not yet been crossed out, and\n • cross out their sum,\nand record that sum.  More precisely, at step $n$ we erase three still–present\nintegers $a_n\\le b_n\\le c_n$ and their sum\n$$s_n=a_n+b_n+c_n.$$\nThe first few erasures are\n$$(1,2,3,6),\\;(4,5,7,16),\\;(8,9,10,27),\\;(11,12,13,36),\\dots.$$\nThus $s_0=6,\\;s_1=16,\\;s_2=27,\\dots$.  Prove that some term $s_n$ ends with the\nfour decimal digits \\textbf{8715}.",
      "solution": "1.  A convenient way to group the steps\n-------------------------------------\nFor $n\\ge 0$ let\n$$a_n\\le b_n\\le c_n,\\qquad s_n=a_n+b_n+c_n.$$\nGroup the steps in blocks of three:\n$$\\text{block }n:\\;\\{s_{3n},s_{3n+1},s_{3n+2}\\}\\qquad(n\\ge0).$$\n\nClaim (a).\nFor every $n\\ge0$ the nine *summands* appearing in block $n$\n$$a_{3n},b_{3n},c_{3n},\\;a_{3n+1},b_{3n+1},c_{3n+1},\\;a_{3n+2},b_{3n+2},c_{3n+2}$$\nare exactly the ten consecutive integers $10n+1,10n+2,\\dots ,10n+10$ with\n*one (and only one)* of the three middle numbers $10n+5,10n+6,10n+7$ missing.\n\nClaim (b) (an immediate consequence of (a))\n$$\\begin{aligned}\ns_{3n}   &=30n+6,\\\\[2pt]\ns_{3n+1} &\\in\\{30n+15,\\,30n+16,\\,30n+17\\},\\\\[2pt]\ns_{3n+2} &=30n+27.\\end{aligned}$$\n\nProof of Claim (a) by induction on $n$\n--------------------------------------\nBase case $n=0$.  Direct computation gives\n$$(a_0,b_0,c_0)=(1,2,3),\\;s_0=6;\\quad(a_1,b_1,c_1)=(4,5,7),\\;s_1=16;\\quad\n(a_2,b_2,c_2)=(8,9,10),\\;s_2=27,$$\nso the nine summands are $\\{1,\\dots ,10\\}\\setminus\\{6\\}$, as required.\n\nInduction step $n\\to n+1$.  Assume (a)$_n$ (hence also (b)$_n$) is true.\n\n(i)   All integers $\\le10n+10$ have already been crossed off.  Indeed they are\nremoved either as original integers in earlier blocks or as the unique missing\nmiddle number of block $n$, which was crossed out earlier as a *sum*.\n\n(ii)  Every sum produced so far ends in the digit $5,6$, or $7$.\n\n    Proof of (ii).\n    By the induction hypothesis we know (b)$_k$ for all $k\\le n$.  That formula\n    shows that $s_{3k}$ ends in $6$, $s_{3k+2}$ in $7$, and $s_{3k+1}$ in\n    $5,6$, or $7$.  No other sums have been produced.\n\nBecause of (ii) no previously produced sum can coincide with a positive integer\nending in $1,2$, or $3$.  Hence, at the beginning of block $n+1$ the first\nnumbers that are *still present* and *have never been a sum* are exactly\n$$10(n+1)+1,\\;10(n+1)+2,\\;10(n+1)+3,$$\nso they are $a_{3(n+1)},b_{3(n+1)},c_{3(n+1)}$ and form the sum\n$$s_{3(n+1)}=(10(n+1)+1)+(10(n+1)+2)+(10(n+1)+3)=30(n+1)+6.$$\n\nRemoving them leaves the four consecutive numbers\n$$10(n+1)+4,\\;10(n+1)+5,\\;10(n+1)+6,\\;10(n+1)+7,$$\nexactly one of the last three having been the missing middle number of an\nearlier block.  The next sum therefore uses the *other* three of these four\nnumbers, establishing the description of $s_{3(n+1)+1}$.  Finally the numbers\n$10(n+1)+8,10(n+1)+9,10(n+1)+10$ are the three smallest remaining, so they form\n$s_{3(n+1)+2}$.  This completes the induction step and thereby the proof of\nClaim (a).\n\n2.  A recursion for the choice $s_{3m+1}$\n----------------------------------------\nDefine\n$$f(m):=s_{3m+1}-(30m+16)\\in\\{-1,0,1\\}\\qquad(m\\ge0).$$\nInterpreting Claim (a) yields\n$$\n  f(m)=\\begin{cases}\n     0 &\\text{if }10m+6 \\text{ is the missing middle number},\\\\[2pt]\n    -1 &\\text{if }10m+7 \\text{ is missing},\\\\[2pt]\n     1 &\\text{if }10m+5 \\text{ is missing}.\n  \\end{cases}\n$$\n\nLemma.  For every $m\\ge0$\n$$\n  f(m)=\\begin{cases}\n          0                         & m\\equiv0\\pmod3,\\\\[4pt]\n         -f\\!\\left(\\dfrac{m-1}{3}\\right) & m\\equiv1\\pmod3,\\\\[10pt]\n         -1                        & m\\equiv2\\pmod3.\\tag{1}\n       \\end{cases}\n$$\n\nProof.\nCompare block $m$ with block $\\lfloor m/3\\rfloor$.\n• If $m\\equiv0$, the exceptional number is $10m+6$, so $f(m)=0$.\n• If $m\\equiv2$, the exceptional number is $10m+7$, so $f(m)=-1$.\n• If $m\\equiv1$, write $m=3q+1$.  The numbers $10q+5,10q+6,10q+7$ are treated\nin block $q$; hence $10m+5=30q+15$ is either already a sum or is still present\nwhen block $m$ begins. A direct inspection of block $m$ shows that the opposite\nchoice is made for its new exceptional number, whence $f(3q+1)=-f(q)$. ∎\n\nA useful corollary of (1) is the implication\n$$m\\equiv2\\pmod3\\;\\Longrightarrow\\;f(m)=-1.\\tag{2}$$\nConsequently, by Claim (b)\n$$m\\equiv2\\pmod3\\;\\Longrightarrow\\;s_{3m+1}=30m+15.\\tag{3}$$\n\n3.  Producing the digits 8715\n-----------------------------\nA number ends with $8715$ precisely when it is congruent to $8715\\pmod{10000}$,\nhence to $15\\pmod{30}$.  By Claim (b) such a remainder occurs only among the\nterms $s_{3m+1}$, so we need\n$$30m+15\\equiv8715\\pmod{10000}.\\tag{4}$$\nCondition (4) is equivalent to\n$$30m\\equiv8700\\pmod{10000}\\;\\Longleftrightarrow\\;3m\\equiv870\\pmod{1000}.$$\nBecause $\\gcd(3,1000)=1$, multiplication by $3^{-1}\\equiv667\\pmod{1000}$ gives\n$$m\\equiv290\\pmod{1000}.\\tag{5}$$\nNote that $290\\equiv2\\pmod3$, so by (2)–(3) every integer of the form\n$$m=290+1000k\\qquad(k\\ge0)$$\nsatisfies $s_{3m+1}=30m+15$.  Taking $k=0$ gives the concrete choice\n$$m=290,\\quad n=3m+1=871.$$\nSubstituting in (3) yields\n$$s_{871}=30\\cdot290+15=8715.$$\nThus the term $s_{871}$ indeed ends with the digits $8715$, completing the\nproof.  ∎",
      "_meta": {
        "core_steps": [
          "Detect a repeating 3-step pattern by checking the first few eliminations.",
          "Inductively prove that each block of three steps removes the ten integers 10n+1,…,10n+10 except one of 10n+5,6,7.",
          "Consequently obtain explicit formulas for the sums: s_{3n}=30n+6, s_{3n+1}∈{30n+15,30n+16,30n+17}, s_{3n+2}=30n+27.",
          "Use modular arithmetic to pick n=3m+1 with m≡2 (mod 3) and 30m+15 ≡ desired_suffix (mod 10 000).",
          "Exhibit any m satisfying those congruences to produce a term ending with the required digits."
        ],
        "mutable_slots": {
          "slot_suffix": {
            "description": "The specific trailing base-10 digits we want a sum to end with; only the modulus in step 4 changes.",
            "original": "2015"
          },
          "slot_witness": {
            "description": "Concrete choice of m (hence n and the sum value) solving the congruences; many possibilities exist.",
            "original": "m=1400  ⇒ n=4201 ⇒ s_{4201}=42015"
          }
        }
      }
    }
  },
  "checked": true,
  "problem_type": "proof",
  "iteratively_fixed": true
}