{
  "index": "2017-B-6",
  "type": "COMB",
  "tag": [
    "COMB",
    "NT",
    "ALG"
  ],
  "difficulty": "",
  "question": "Find the number of ordered $64$-tuples $(x_0,x_1,\\dots,x_{63})$ such that $x_0,x_1,\\dots,x_{63}$ are distinct elements of $\\{1,2,\\dots,2017\\}$ and \n\\[\nx_0 + x_1 + 2x_2 + 3x_3 + \\cdots + 63 x_{63}\n\\]\nis divisible by 2017.\n\\end{itemize}\n\n\\end{document}",
  "solution": "\\textbf{First solution.}\nThe desired count is $\\frac{2016!}{1953!}- 63! \\cdot 2016$, which we compute using the principle of inclusion-exclusion.\nAs in A2, we use the fact that 2017 is prime; this means that we can do linear algebra over the field $\\mathbb{F}_{2017}$. In particular, every nonzero homogeneous linear equation in $n$ variables over $\\mathbb{F}_{2017}$ has exactly $2017^{n-1}$ solutions.\n\nFor $\\pi$ a partition of $\\{0,\\dots,63\\}$,\nlet $|\\pi|$ denote the number of distinct parts of $\\pi$,\nLet $\\pi_0$ denote the partition of $\\{0,\\dots,63\\}$ into 64 singleton parts.\nLet $\\pi_1$ denote the partition of $\\{0,\\dots,63\\}$ into one 64-element part.\nFor $\\pi, \\sigma$ two partitions of $\\{0,\\dots,63\\}$, write $\\pi | \\sigma$ if $\\pi$ is a refinement of $\\sigma$\n(that is, every part in $\\sigma$ is a union of parts in $\\pi$). By induction on $|\\pi|$, we may construct \na collection of integers $\\mu_\\pi$, one for each $\\pi$, with the properties that\n\\[\n\\sum_{\\pi | \\sigma} \\mu_\\pi = \\begin{cases} 1 & \\sigma = \\pi_0 \\\\ 0 & \\sigma \\neq \\pi_0 \\end{cases}.\n\\]\nDefine the sequence $c_0, \\dots, c_{63}$ by setting $c_0 = 1$ and $c_i = i$ for $i>1$.\nLet $N_\\pi$ be the number of ordered 64-tuples $(x_0,\\dots,x_{63})$ of elements of $\\mathbb{F}_{2017}$\nsuch that  $x_i = x_j$ whenever $i$ and $j$ belong to the same part and\n$\\sum_{i=0}^{63} c_i x_i$ is divisible by 2017. Then $N_\\pi$ equals $2017^{|\\pi|-1}$\nunless for each part $S$ of $\\pi$, the sum $\\sum_{i \\in S} c_i$ vanishes; in that case,\n$N_\\pi$ instead equals $2017^{|\\pi|}$.\nSince $c_0, \\dots, c_{63}$ are positive integers which sum to $1 + \\frac{63 \\cdot 64}{2} = 2017$, the second outcome only occurs for $\\pi = \\pi_1$. By inclusion-exclusion, the desired count may be written as \n\\[\n\\sum_{\\pi} \\mu_\\pi N_\\pi = 2016 \\cdot \\mu_{\\pi_1} + \\sum_{\\pi} \\mu_\\pi 2017^{|\\pi|-1}.\n\\]\nSimilarly, the number of ordered 64-tuples with no repeated elements may be written as\n\\[\n64! \\binom{2017}{64} = \\sum_{\\pi} \\mu_\\pi 2017^{|\\pi|}.\n\\]\nThe desired quantity may thus be written as $\\frac{2016!}{1953!} + 2016 \\mu_{\\pi_1}$.\n\nIt remains to compute $\\mu_{\\pi_1}$. We adopt an approach suggested by David Savitt: apply inclusion-exclusion\nto count distinct 64-tuples in an \\emph{arbitrary} set $A$. As above, this yields\n\\[\n|A|(|A|-1) \\cdots (|A|-63) = \\sum_{\\pi} \\mu_\\pi |A|^{|\\pi|}.\n\\]\nViewing both sides as polynomials in $|A|$ and comparing coefficients in degree 1 yields\n$\\mu_\\pi = -63!$ and thus the claimed answer.\n\n\\noindent\n\\textbf{Second solution.}\n(from Art of Problem Solving, user \\texttt{ABCDE})\nWe first prove an auxiliary result. \n\\begin{lemma*}\nFix a prime $p$ and define the function $f(k)$ on positive integers by the conditions\n\\begin{align*}\nf(1,p) &= 0 \\\\\nf(k,p) &= \\frac{(p-1)!}{(p-k)!} - kf(k-1,p) \\qquad (k>1).\n\\end{align*}\nThen for any positive integers $a_1,\\dots,a_k$ with\n$a_1 + \\cdots + a_k < p$, there are exactly $f(p)$ solutions to the equation $a_1 x_1 + \\cdots + a_k x_k = 0$\nwith $x_1,\\dots,x_k \\in \\mathbb{F}_p$ nonzero and pairwise distinct.\n\\end{lemma*}\n\\begin{proof}\nWe check the claim by induction, with the base case $k=1$ being obvious.\nFor the induction step, assume the claim for $k-1$.\nLet $S$ be the set of $k$-tuples of distinct elements of $\\mathbb{F}_p$;\nit consists of $\\frac{p!}{(p-k)!}$ elements.\nThis set is stable under the action of $i \\in \\mathbb{F}_p$ by translation:\n\\[\n(x_1,\\dots,x_k) \\mapsto (x_1 + i, \\dots, x_k + i).\n\\]\nSince $0 < a_1 \\cdots + a_k < p$, exactly one element of each orbit gives a solution of\n$a_1 x_1 + \\cdots + a_k x_k = 0$. Each of these solutions contributes to $f(k)$ except\nfor those in which $x_i = 0$ for some $i$.\nSince then $x_j \\neq 0$ for all $j \\neq i$, we may apply the induction hypothesis to see that there are\n$f(k-1,p)$ solutions that arise this way for a given $i$ (and these do not overlap).\nThis proves the claim.\n\\end{proof}\n\nTo compute $f(k,p)$ explicitly, it is convenient to work with the auxiliary function\n\\[\ng(k,p) = \\frac{p f(k,p)}{k!};\n\\]\nby the lemma, this satisfies $g(1,p) = 0$ and \n\\begin{align*}\ng(k,p) &= \\binom{p}{k} - g(k-1,p)  \\\\\n&= \\binom{p-1}{k} + \\binom{p-1}{k-1} - g(k-1, p) \\qquad (k>1).\n\\end{align*}\nBy induction on $k$, we deduce that\n\\begin{align*}\ng(k,p) - \\binom{p-1}{k} &= (-1)^{k-1} \\left( g(1,p) - \\binom{p-1}{1} \\right) \\\\\n &= (-1)^k (p-1)\n\\end{align*}\nand hence\n$g(k,p) = \\binom{p-1}{k} + (-1)^k (p-1)$.\n\nWe now set $p=2017$ and count the tuples in question.\nDefine $c_0,\\dots,c_{63}$ as in the first solution. Since $c_0 + \\cdots + c_{63} = p$,\nthe translation action of $\\mathbb{F}_p$ preserves the set of tuples; we may thus assume without loss of generality\nthat $x_0 = 0$ and multiply the count by $p$ at the end. That is, the desired answer is\n\\begin{align*}\n2017 f(63, 2017) &= 63! g(63, 2017) \\\\\n& = 63! \\left( \\binom{2016}{63} - 2016 \\right)\n\\end{align*}\nas claimed.\n\n\\end{itemize}\n\\end{document}",
  "vars": [
    "x",
    "i",
    "j",
    "k",
    "n"
  ],
  "params": [
    "c",
    "N",
    "S",
    "A",
    "p",
    "f",
    "g",
    "a",
    "\\\\pi",
    "\\\\sigma",
    "\\\\mu"
  ],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "x": "elemlist",
        "i": "indexone",
        "j": "indextwo",
        "k": "indexthr",
        "n": "varcount",
        "c": "coeffsym",
        "N": "countvar",
        "S": "subsetvar",
        "A": "arbitset",
        "p": "primefld",
        "f": "funcmain",
        "g": "auxifun",
        "a": "coeffain",
        "\\pi": "partition",
        "\\sigma": "sigmasym",
        "\\mu": "muconst"
      },
      "question": "Find the number of ordered $64$-tuples $(elemlist_0,elemlist_1,\\dots,elemlist_{63})$ such that $elemlist_0,elemlist_1,\\dots,elemlist_{63}$ are distinct elements of $\\{1,2,\\dots,2017\\}$ and \n\\[\n elemlist_0 + elemlist_1 + 2elemlist_2 + 3elemlist_3 + \\cdots + 63 elemlist_{63}\n\\]\nis divisible by 2017.",
      "solution": "\\textbf{First solution.}\nThe desired count is $\\frac{2016!}{1953!}- 63! \\cdot 2016$, which we compute using the principle of inclusion-exclusion.\nAs in A2, we use the fact that 2017 is prime; this means that we can do linear algebra over the field $\\mathbb{F}_{2017}$. In particular, every nonzero homogeneous linear equation in $varcount$ variables over $\\mathbb{F}_{2017}$ has exactly $2017^{varcount-1}$ solutions.\n\nFor $partition$ a partition of $\\{0,\\dots,63\\}$,\nlet $|partition|$ denote the number of distinct parts of $partition$,\nLet $partition_0$ denote the partition of $\\{0,\\dots,63\\}$ into 64 singleton parts.\nLet $partition_1$ denote the partition of $\\{0,\\dots,63\\}$ into one 64-element part.\nFor $partition, sigmasym$ two partitions of $\\{0,\\dots,63\\}$, write $partition | sigmasym$ if $partition$ is a refinement of $sigmasym$\n(that is, every part in $sigmasym$ is a union of parts in $partition$). By induction on $|partition|$, we may construct \na collection of integers $muconst_{partition}$, one for each $partition$, with the properties that\n\\[\n\\sum_{partition | sigmasym} muconst_{partition} = \\begin{cases} 1 & sigmasym = partition_0 \\\\ 0 & sigmasym \\neq partition_0 \\end{cases}.\n\\]\nDefine the sequence $coeffsym_0, \\dots, coeffsym_{63}$ by setting $coeffsym_0 = 1$ and $coeffsym_i = i$ for $i>1$.\nLet $countvar_{partition}$ be the number of ordered 64-tuples $(elemlist_0,\\dots,elemlist_{63})$ of elements of $\\mathbb{F}_{2017}$\nsuch that  $elemlist_i = elemlist_j$ whenever $i$ and $j$ belong to the same part and\n$\\sum_{i=0}^{63} coeffsym_i elemlist_i$ is divisible by 2017. Then $countvar_{partition}$ equals $2017^{|partition|-1}$\nunless for each part $S$ of $partition$, the sum $\\sum_{i \\in S} coeffsym_i$ vanishes; in that case,\n$countvar_{partition}$ instead equals $2017^{|partition|}$.\nSince $coeffsym_0, \\dots, coeffsym_{63}$ are positive integers which sum to $1 + \\frac{63 \\cdot 64}{2} = 2017$, the second outcome only occurs for $partition = partition_1$. By inclusion-exclusion, the desired count may be written as \n\\[\n\\sum_{partition} muconst_{partition} \\, countvar_{partition} = 2016 \\cdot muconst_{partition_1} + \\sum_{partition} muconst_{partition} 2017^{|partition|-1}.\n\\]\nSimilarly, the number of ordered 64-tuples with no repeated elements may be written as\n\\[\n64! \\binom{2017}{64} = \\sum_{partition} muconst_{partition} 2017^{|partition|}.\n\\]\nThe desired quantity may thus be written as $\\frac{2016!}{1953!} + 2016 \\, muconst_{partition_1}$.\n\nIt remains to compute $muconst_{partition_1}$. We adopt an approach suggested by David Savitt: apply inclusion-exclusion\nto count distinct 64-tuples in an \\emph{arbitrary} set $arbitset$. As above, this yields\n\\[\n|arbitset|(|arbitset|-1) \\cdots (|arbitset|-63) = \\sum_{partition} muconst_{partition} |arbitset|^{|partition|}.\n\\]\nViewing both sides as polynomials in $|arbitset|$ and comparing coefficients in degree 1 yields\n$muconst_{partition} = -63!$ and thus the claimed answer.\n\n\\noindent\n\\textbf{Second solution.}\n(from Art of Problem Solving, user \\texttt{ABCDE})\nWe first prove an auxiliary result. \n\\begin{lemma*}\nFix a prime $primefld$ and define the function $funcmain(indexthr,primefld)$ on positive integers by the conditions\n\\begin{align*}\nfuncmain(1,primefld) &= 0 \\\\\nfuncmain(indexthr,primefld) &= \\frac{(primefld-1)!}{(primefld-indexthr)!} - indexthr\\,funcmain(indexthr-1,primefld) \\qquad (indexthr>1).\n\\end{align*}\nThen for any positive integers $coeffain_1,\\dots,coeffain_{indexthr}$ with\n$coeffain_1 + \\cdots + coeffain_{indexthr} < primefld$, there are exactly $funcmain(primefld)$ solutions to the equation $coeffain_1 elemlist_1 + \\cdots + coeffain_{indexthr} elemlist_{indexthr} = 0$\nwith $elemlist_1,\\dots,elemlist_{indexthr} \\in \\mathbb{F}_{primefld}$ nonzero and pairwise distinct.\n\\end{lemma*}\n\\begin{proof}\nWe check the claim by induction, with the base case $indexthr=1$ being obvious.\nFor the induction step, assume the claim for $indexthr-1$.\nLet $subsetvar$ be the set of $indexthr$-tuples of distinct elements of $\\mathbb{F}_{primefld}$;\nit consists of $\\frac{primefld!}{(primefld-indexthr)!}$ elements.\nThis set is stable under the action of $indexone \\in \\mathbb{F}_{primefld}$ by translation:\n\\[\n(elemlist_1,\\dots,elemlist_{indexthr}) \\mapsto (elemlist_1 + indexone, \\dots, elemlist_{indexthr} + indexone).\n\\]\nSince $0 < coeffain_1 \\cdots + coeffain_{indexthr} < primefld$, exactly one element of each orbit gives a solution of\n$coeffain_1 elemlist_1 + \\cdots + coeffain_{indexthr} elemlist_{indexthr} = 0$. Each of these solutions contributes to $funcmain(indexthr)$ except\nfor those in which $elemlist_i = 0$ for some $i$.\nSince then $elemlist_j \\neq 0$ for all $j \\neq i$, we may apply the induction hypothesis to see that there are\n$funcmain(indexthr-1,primefld)$ solutions that arise this way for a given $i$ (and these do not overlap).\nThis proves the claim.\n\\end{proof}\n\nTo compute $funcmain(indexthr,primefld)$ explicitly, it is convenient to work with the auxiliary function\n\\[\nauxifun(indexthr,primefld) = \\frac{primefld \\, funcmain(indexthr,primefld)}{indexthr!};\n\\]\nby the lemma, this satisfies $auxifun(1,primefld) = 0$ and \n\\begin{align*}\nauxifun(indexthr,primefld) &= \\binom{primefld}{indexthr} - auxifun(indexthr-1,primefld)  \\\\\n&= \\binom{primefld-1}{indexthr} + \\binom{primefld-1}{indexthr-1} - auxifun(indexthr-1, primefld) \\qquad (indexthr>1).\n\\end{align*}\nBy induction on $indexthr$, we deduce that\n\\begin{align*}\nauxifun(indexthr,primefld) - \\binom{primefld-1}{indexthr} &= (-1)^{indexthr-1} \\left( auxifun(1,primefld) - \\binom{primefld-1}{1} \\right) \\\\\n &= (-1)^{indexthr} (primefld-1)\n\\end{align*}\nand hence\n$auxifun(indexthr,primefld) = \\binom{primefld-1}{indexthr} + (-1)^{indexthr} (primefld-1)$.\n\nWe now set $primefld=2017$ and count the tuples in question.\nDefine $coeffsym_0,\\dots,coeffsym_{63}$ as in the first solution. Since $coeffsym_0 + \\cdots + coeffsym_{63} = primefld$,\nthe translation action of $\\mathbb{F}_{primefld}$ preserves the set of tuples; we may thus assume without loss of generality\nthat $elemlist_0 = 0$ and multiply the count by $primefld$ at the end. That is, the desired answer is\n\\begin{align*}\n2017 \\, funcmain(63, 2017) &= 63! \\, auxifun(63, 2017) \\\\\n& = 63! \\left( \\binom{2016}{63} - 2016 \\right)\n\\end{align*}\nas claimed.\n"
    },
    "descriptive_long_confusing": {
      "map": {
        "x": "longitude",
        "i": "gemstone",
        "j": "tranquil",
        "k": "sailboat",
        "n": "moisture",
        "c": "umbrella",
        "N": "carousel",
        "S": "starlight",
        "A": "evergreen",
        "p": "parchment",
        "f": "nebulous",
        "g": "thunders",
        "a": "lighthouse",
        "\\pi": "sunflower",
        "\\sigma": "whirlwind",
        "\\mu": "chocolate"
      },
      "question": "Find the number of ordered $64$-tuples $(longitude_0,longitude_1,\\dots,longitude_{63})$ such that $longitude_0,longitude_1,\\dots,longitude_{63}$ are distinct elements of $\\{1,2,\\dots,2017\\}$ and \n\\[\nlongitude_0 + longitude_1 + 2longitude_2 + 3longitude_3 + \\cdots + 63 longitude_{63}\n\\]\nis divisible by 2017.",
      "solution": "\\textbf{First solution.}\nThe desired count is $\\frac{2016!}{1953!}- 63! \\cdot 2016$, which we compute using the principle of inclusion-exclusion.\nAs in A2, we use the fact that 2017 is prime; this means that we can do linear algebra over the field $\\mathbb{F}_{2017}$. In particular, every nonzero homogeneous linear equation in $moisture$ variables over $\\mathbb{F}_{2017}$ has exactly $2017^{moisture-1}$ solutions.\n\nFor $sunflower$ a partition of $\\{0,\\dots,63\\}$,\nlet $|sunflower|$ denote the number of distinct parts of $sunflower$,\nlet $sunflower_0$ denote the partition of $\\{0,\\dots,63\\}$ into 64 singleton parts,\nand let $sunflower_1$ denote the partition of $\\{0,\\dots,63\\}$ into one 64-element part.\nFor $sunflower, whirlwind$ two partitions of $\\{0,\\dots,63\\}$, write $sunflower | whirlwind$ if $sunflower$ is a refinement of $whirlwind$\n(that is, every part in $whirlwind$ is a union of parts in $sunflower$). By induction on $|sunflower|$, we may construct \na collection of integers $chocolate_{sunflower}$, one for each $sunflower$, with the properties that\n\\[\n\\sum_{sunflower | whirlwind} chocolate_{sunflower} = \\begin{cases} 1 & whirlwind = sunflower_0 \\\\ 0 & whirlwind \\neq sunflower_0 \\end{cases}.\n\\]\nDefine the sequence $umbrella_0, \\dots, umbrella_{63}$ by setting $umbrella_0 = 1$ and $umbrella_{gemstone} = gemstone$ for $gemstone>1$.\nLet $carousel_{sunflower}$ be the number of ordered 64-tuples $(longitude_0,\\dots,longitude_{63})$ of elements of $\\mathbb{F}_{2017}$\nsuch that  $longitude_{gemstone} = longitude_{tranquil}$ whenever $gemstone$ and $tranquil$ belong to the same part and\n$\\sum_{gemstone=0}^{63} umbrella_{gemstone} longitude_{gemstone}$ is divisible by 2017. Then $carousel_{sunflower}$ equals $2017^{|sunflower|-1}$\nunless for each part $starlight$ of $sunflower$, the sum $\\sum_{gemstone \\in starlight} umbrella_{gemstone}$ vanishes; in that case,\n$carousel_{sunflower}$ instead equals $2017^{|sunflower|}$.\nSince $umbrella_0, \\dots, umbrella_{63}$ are positive integers which sum to $1 + \\frac{63 \\cdot 64}{2} = 2017$, the second outcome only occurs for $sunflower = sunflower_1$. By inclusion-exclusion, the desired count may be written as \n\\[\n\\sum_{sunflower} chocolate_{sunflower} carousel_{sunflower} = 2016 \\cdot chocolate_{sunflower_1} + \\sum_{sunflower} chocolate_{sunflower} 2017^{|sunflower|-1}.\n\\]\nSimilarly, the number of ordered 64-tuples with no repeated elements may be written as\n\\[\n64! \\binom{2017}{64} = \\sum_{sunflower} chocolate_{sunflower} 2017^{|sunflower|}.\n\\]\nThe desired quantity may thus be written as $\\frac{2016!}{1953!} + 2016 chocolate_{sunflower_1}$.\n\nIt remains to compute $chocolate_{sunflower_1}$. We adopt an approach suggested by David Savitt: apply inclusion-exclusion\nto count distinct 64-tuples in an \\emph{arbitrary} set $evergreen$. As above, this yields\n\\[\n|evergreen|(|evergreen|-1) \\cdots (|evergreen|-63) = \\sum_{sunflower} chocolate_{sunflower} |evergreen|^{|sunflower|}.\n\\]\nViewing both sides as polynomials in $|evergreen|$ and comparing coefficients in degree 1 yields\n$chocolate_{sunflower} = -63!$ and thus the claimed answer.\n\n\\noindent\n\\textbf{Second solution.}\n(from Art of Problem Solving, user \\texttt{ABCDE})\nWe first prove an auxiliary result. \n\\begin{lemma*}\nFix a prime $parchment$ and define the function $nebulous(sailboat,parchment)$ on positive integers by the conditions\n\\begin{align*}\nnebulous(1,parchment) &= 0 \\\\\nnebulous(sailboat,parchment) &= \\frac{(parchment-1)!}{(parchment-sailboat)!} - sailboat \\, nebulous(sailboat-1,parchment) \\qquad (sailboat>1).\n\\end{align*}\nThen for any positive integers $lighthouse_1,\\dots,lighthouse_{sailboat}$ with\n$lighthouse_1 + \\cdots + lighthouse_{sailboat} < parchment$, there are exactly $nebulous(parchment)$ solutions to the equation $lighthouse_1 longitude_1 + \\cdots + lighthouse_{sailboat} longitude_{sailboat} = 0$\nwith $longitude_1,\\dots,longitude_{sailboat} \\in \\mathbb{F}_{parchment}$ nonzero and pairwise distinct.\n\\end{lemma*}\n\\begin{proof}\nWe check the claim by induction, with the base case $sailboat=1$ being obvious.\nFor the induction step, assume the claim for $sailboat-1$.\nLet $starlight$ be the set of $sailboat$-tuples of distinct elements of $\\mathbb{F}_{parchment}$;\nit consists of $\\frac{parchment!}{(parchment-sailboat)!}$ elements.\nThis set is stable under the action of $gemstone \\in \\mathbb{F}_{parchment}$ by translation:\n\\[\n(longitude_1,\\dots,longitude_{sailboat}) \\mapsto (longitude_1 + gemstone, \\dots, longitude_{sailboat} + gemstone).\n\\]\nSince $0 < lighthouse_1 \\cdots + lighthouse_{sailboat} < parchment$, exactly one element of each orbit gives a solution of\n$lighthouse_1 longitude_1 + \\cdots + lighthouse_{sailboat} longitude_{sailboat} = 0$. Each of these solutions contributes to $nebulous(sailboat)$ except\nfor those in which $longitude_{gemstone} = 0$ for some $gemstone$.\nSince then $longitude_{tranquil} \\neq 0$ for all $tranquil \\neq gemstone$, we may apply the induction hypothesis to see that there are\n$nebulous(sailboat-1,parchment)$ solutions that arise this way for a given $gemstone$ (and these do not overlap).\nThis proves the claim.\n\\end{proof}\n\nTo compute $nebulous(sailboat,parchment)$ explicitly, it is convenient to work with the auxiliary function\n\\[\nthunders(sailboat,parchment) = \\frac{parchment \\, nebulous(sailboat,parchment)}{sailboat!};\n\\]\nby the lemma, this satisfies $thunders(1,parchment) = 0$ and \n\\begin{align*}\nthunders(sailboat,parchment) &= \\binom{parchment}{sailboat} - thunders(sailboat-1,parchment)  \\\\\n&= \\binom{parchment-1}{sailboat} + \\binom{parchment-1}{sailboat-1} - thunders(sailboat-1, parchment) \\qquad (sailboat>1).\n\\end{align*}\nBy induction on $sailboat$, we deduce that\n\\begin{align*}\nthunders(sailboat,parchment) - \\binom{parchment-1}{sailboat} &= (-1)^{sailboat-1} \\left( thunders(1,parchment) - \\binom{parchment-1}{1} \\right) \\\\\n &= (-1)^{sailboat} (parchment-1)\n\\end{align*}\nand hence\n$thunders(sailboat,parchment) = \\binom{parchment-1}{sailboat} + (-1)^{sailboat} (parchment-1)$.\n\nWe now set $parchment=2017$ and count the tuples in question.\nDefine $umbrella_0,\\dots,umbrella_{63}$ as in the first solution. Since $umbrella_0 + \\cdots + umbrella_{63} = parchment$,\nthe translation action of $\\mathbb{F}_{parchment}$ preserves the set of tuples; we may thus assume without loss of generality\nthat $longitude_0 = 0$ and multiply the count by $parchment$ at the end. That is, the desired answer is\n\\begin{align*}\n2017 \\, nebulous(63, 2017) &= 63! \\, thunders(63, 2017) \\\\\n& = 63! \\left( \\binom{2016}{63} - 2016 \\right)\n\\end{align*}\nas claimed."
    },
    "descriptive_long_misleading": {
      "map": {
        "x": "knownunit",
        "i": "aggregate",
        "j": "principal",
        "k": "culminate",
        "n": "limitless",
        "c": "variable",
        "N": "voidness",
        "S": "disunion",
        "A": "nothingness",
        "p": "composite",
        "f": "constant",
        "g": "stagnant",
        "a": "solution",
        "\\\\pi": "uniformity",
        "\\\\sigma": "simplicity",
        "\\\\mu": "dimension"
      },
      "question": "Find the number of ordered $64$-tuples $(knownunit_0,knownunit_1,\\dots,knownunit_{63})$ such that $knownunit_0,knownunit_1,\\dots,knownunit_{63}$ are distinct elements of $\\{1,2,\\dots,2017\\}$ and \n\\[\nknownunit_0 + knownunit_1 + 2\\,knownunit_2 + 3\\,knownunit_3 + \\cdots + 63\\,knownunit_{63}\n\\]\nis divisible by 2017.",
      "solution": "\\textbf{First solution.}\nThe desired count is $\\frac{2016!}{1953!}- 63! \\cdot 2016$, which we compute using the principle of inclusion-exclusion.\nAs in A2, we use the fact that 2017 is prime; this means that we can do linear algebra over the field $\\mathbb{F}_{2017}$. In particular, every nonzero homogeneous linear equation in $limitless$ variables over $\\mathbb{F}_{2017}$ has exactly $2017^{limitless-1}$ solutions.\n\nFor $uniformity$ a partition of $\\{0,\\dots,63\\}$,\nlet $|uniformity|$ denote the number of distinct parts of $uniformity$.\nLet $uniformity_0$ denote the partition of $\\{0,\\dots,63\\}$ into 64 singleton parts.\nLet $uniformity_1$ denote the partition of $\\{0,\\dots,63\\}$ into one 64-element part.\nFor $uniformity,\\,simplicity$ two partitions of $\\{0,\\dots,63\\}$, write $uniformity \\mid simplicity$ if $uniformity$ is a refinement of $simplicity$\n(that is, every part in $simplicity$ is a union of parts in $uniformity$). By induction on $|uniformity|$, we may construct \na collection of integers $dimension_{uniformity}$, one for each $uniformity$, with the properties that\n\\[\n\\sum_{uniformity \\mid simplicity} dimension_{uniformity} = \\begin{cases} 1 & simplicity = uniformity_0 \\\\ 0 & simplicity \\neq uniformity_0 \\end{cases}.\n\\]\nDefine the sequence $variable_0, \\dots, variable_{63}$ by setting $variable_0 = 1$ and $variable_{aggregate} = \\aggregate$ for $\\aggregate>1$.\nLet $voidness_{uniformity}$ be the number of ordered 64-tuples $(knownunit_0,\\dots,knownunit_{63})$ of elements of $\\mathbb{F}_{2017}$\nsuch that  $knownunit_{\\aggregate} = knownunit_{\\principal}$ whenever $\\aggregate$ and $\\principal$ belong to the same part and\n$\\sum_{\\aggregate=0}^{63} variable_{\\aggregate}\\,knownunit_{\\aggregate}$ is divisible by 2017. Then $voidness_{uniformity}$ equals $2017^{|uniformity|-1}$\nunless for each part $disunion$ of $uniformity$, the sum $\\sum_{\\aggregate \\in disunion} variable_{\\aggregate}$ vanishes; in that case,\n$voidness_{uniformity}$ instead equals $2017^{|uniformity|}$.\nSince $variable_0, \\dots, variable_{63}$ are positive integers which sum to $1 + \\frac{63 \\cdot 64}{2} = 2017$, the second outcome only occurs for $uniformity = uniformity_1$. By inclusion-exclusion, the desired count may be written as \n\\[\n\\sum_{uniformity} dimension_{uniformity}\\,voidness_{uniformity} = 2016 \\cdot dimension_{uniformity_1} + \\sum_{uniformity} dimension_{uniformity}\\,2017^{|uniformity|-1}.\n\\]\nSimilarly, the number of ordered 64-tuples with no repeated elements may be written as\n\\[\n64! \\binom{2017}{64} = \\sum_{uniformity} dimension_{uniformity}\\,2017^{|uniformity|}.\n\\]\nThe desired quantity may thus be written as $\\frac{2016!}{1953!} + 2016\\,dimension_{uniformity_1}$.\n\nIt remains to compute $dimension_{uniformity_1}$. We adopt an approach suggested by David Savitt: apply inclusion-exclusion\nto count distinct 64-tuples in an \\emph{arbitrary} set $nothingness$. As above, this yields\n\\[\n|nothingness|(|nothingness|-1) \\cdots (|nothingness|-63) \n= \\sum_{uniformity} dimension_{uniformity} |nothingness|^{|uniformity|}.\n\\]\nViewing both sides as polynomials in $|nothingness|$ and comparing coefficients in degree 1 yields\n$dimension_{uniformity} = -63!$ and thus the claimed answer.\n\n\\noindent\n\\textbf{Second solution.}\n(from Art of Problem Solving, user \\texttt{ABCDE})\nWe first prove an auxiliary result. \n\\begin{lemma*}\nFix a prime $composite$ and define the function $constant(culminate)$ on positive integers by the conditions\n\\begin{align*}\nconstant(1,composite) &= 0 \\\\\nconstant(culminate,composite) &= \\frac{(composite-1)!}{(composite-culminate)!} - culminate\\,constant(culminate-1,composite) \\qquad (culminate>1).\n\\end{align*}\nThen for any positive integers $solution_1,\\dots,solution_{culminate}$ with\n$solution_1 + \\cdots + solution_{culminate} < composite$, there are exactly $constant(composite)$ solutions to the equation $solution_1 knownunit_1 + \\cdots + solution_{culminate} knownunit_{culminate} = 0$\nwith $knownunit_1,\\dots,knownunit_{culminate} \\in \\mathbb{F}_{composite}$ nonzero and pairwise distinct.\n\\end{lemma*}\n\\begin{proof}\nWe check the claim by induction, with the base case $culminate=1$ being obvious.\nFor the induction step, assume the claim for $culminate-1$.\nLet $disunion$ be the set of $culminate$-tuples of distinct elements of $\\mathbb{F}_{composite}$;\nit consists of $\\frac{composite!}{(composite-culminate)!}$ elements.\nThis set is stable under the action of $\\aggregate \\in \\mathbb{F}_{composite}$ by translation:\n\\[\n(knownunit_1,\\dots,knownunit_{culminate}) \\mapsto (knownunit_1 + \\aggregate, \\dots, knownunit_{culminate} + \\aggregate).\n\\]\nSince $0 < solution_1 \\cdots + solution_{culminate} < composite$, exactly one element of each orbit gives a solution of\n$solution_1 knownunit_1 + \\cdots + solution_{culminate} knownunit_{culminate} = 0$. Each of these solutions contributes to $constant(culminate)$ except\nfor those in which $knownunit_{\\aggregate} = 0$ for some $\\aggregate$.\nSince then $knownunit_{\\principal} \\neq 0$ for all $\\principal \\neq \\aggregate$, we may apply the induction hypothesis to see that there are\n$constant(culminate-1,composite)$ solutions that arise this way for a given $\\aggregate$ (and these do not overlap).\nThis proves the claim.\n\\end{proof}\n\nTo compute $constant(culminate,composite)$ explicitly, it is convenient to work with the auxiliary function\n\\[\nstagnant(culminate,composite) = \\frac{composite\\,constant(culminate,composite)}{culminate!};\n\\]\nby the lemma, this satisfies $stagnant(1,composite) = 0$ and \n\\begin{align*}\nstagnant(culminate,composite) &= \\binom{composite}{culminate} - stagnant(culminate-1,composite)  \\\\\n&= \\binom{composite-1}{culminate} + \\binom{composite-1}{culminate-1} - stagnant(culminate-1, composite) \\qquad (culminate>1).\n\\end{align*}\nBy induction on $culminate$, we deduce that\n\\begin{align*}\nstagnant(culminate,composite) - \\binom{composite-1}{culminate} &= (-1)^{culminate-1} \\left( stagnant(1,composite) - \\binom{composite-1}{1} \\right) \\\\\n &= (-1)^{culminate} (composite-1)\n\\end{align*}\nand hence\n$stagnant(culminate,composite) = \\binom{composite-1}{culminate} + (-1)^{culminate} (composite-1)$.\n\nWe now set $composite=2017$ and count the tuples in question.\nDefine $variable_0,\\dots,variable_{63}$ as in the first solution. Since $variable_0 + \\cdots + variable_{63} = composite$,\nthe translation action of $\\mathbb{F}_{composite}$ preserves the set of tuples; we may thus assume without loss of generality\nthat $knownunit_0 = 0$ and multiply the count by composite at the end. That is, the desired answer is\n\\begin{align*}\n2017\\,constant(63, 2017) &= 63!\\,stagnant(63, 2017) \\\\\n& = 63! \\left( \\binom{2016}{63} - 2016 \\right)\n\\end{align*}\nas claimed.\n\n\\end{itemize}\n\\end{document}"
    },
    "garbled_string": {
      "map": {
        "x": "qzxwvtnpio",
        "i": "hjgrkslaem",
        "j": "prxdluwocb",
        "k": "vczmbtnrha",
        "n": "lyqpsodixe",
        "c": "tgmqnsheva",
        "N": "dwrfcxplib",
        "S": "uoehslvkqr",
        "A": "zmikgtrpwa",
        "p": "ybncjqfhdu",
        "f": "aslvkmnweq",
        "g": "kzrtjqmnob",
        "a": "htewpsfivg",
        "\\pi": "oqdmlhypxz",
        "\\sigma": "rbiwvnktsa",
        "\\mu": "scfyhgznpl"
      },
      "question": "Find the number of ordered $64$-tuples $(qzxwvtnpio_0,qzxwvtnpio_1,\\dots,qzxwvtnpio_{63})$ such that $qzxwvtnpio_0,qzxwvtnpio_1,\\dots,qzxwvtnpio_{63}$ are distinct elements of $\\{1,2,\\dots,2017\\}$ and \n\\[\nqzxwvtnpio_0 + qzxwvtnpio_1 + 2qzxwvtnpio_2 + 3qzxwvtnpio_3 + \\cdots + 63 qzxwvtnpio_{63}\n\\]\nis divisible by 2017.\n",
      "solution": "\\textbf{First solution.}\nThe desired count is $\\frac{2016!}{1953!}- 63! \\cdot 2016$, which we compute using the principle of inclusion-exclusion.\nAs in A2, we use the fact that 2017 is prime; this means that we can do linear algebra over the field $\\mathbb{F}_{2017}$. In particular, every nonzero homogeneous linear equation in $lyqpsodixe$ variables over $\\mathbb{F}_{2017}$ has exactly $2017^{lyqpsodixe-1}$ solutions.\n\nFor $oqdmlhypxz$ a partition of $\\{0,\\dots,63\\}$,\nlet $|oqdmlhypxz|$ denote the number of distinct parts of $oqdmlhypxz$,\nLet $oqdmlhypxz_0$ denote the partition of $\\{0,\\dots,63\\}$ into 64 singleton parts.\nLet $oqdmlhypxz_1$ denote the partition of $\\{0,\\dots,63\\}$ into one 64-element part.\nFor $oqdmlhypxz, rbiwvnktsa$ two partitions of $\\{0,\\dots,63\\}$, write $oqdmlhypxz | rbiwvnktsa$ if $oqdmlhypxz$ is a refinement of $rbiwvnktsa$\n(that is, every part in $rbiwvnktsa$ is a union of parts in $oqdmlhypxz$). By induction on $|oqdmlhypxz|$, we may construct \na collection of integers $scfyhgznpl_{oqdmlhypxz}$, one for each $oqdmlhypxz$, with the properties that\n\\[\n\\sum_{oqdmlhypxz | rbiwvnktsa} scfyhgznpl_{oqdmlhypxz} = \\begin{cases} 1 & rbiwvnktsa = oqdmlhypxz_0 \\\\ 0 & rbiwvnktsa \\neq oqdmlhypxz_0 \\end{cases}.\n\\]\nDefine the sequence $tgmqnsheva_0, \\dots, tgmqnsheva_{63}$ by setting $tgmqnsheva_0 = 1$ and $tgmqnsheva_{hjgrkslaem} = hjgrkslaem$ for $hjgrkslaem>1$.\nLet $dwrfcxplib_{oqdmlhypxz}$ be the number of ordered 64-tuples $(qzxwvtnpio_0,\\dots,qzxwvtnpio_{63})$ of elements of $\\mathbb{F}_{2017}$\nsuch that  $qzxwvtnpio_{hjgrkslaem} = qzxwvtnpio_{prxdluwocb}$ whenever $hjgrkslaem$ and $prxdluwocb$ belong to the same part and\n$\\sum_{hjgrkslaem=0}^{63} tgmqnsheva_{hjgrkslaem} qzxwvtnpio_{hjgrkslaem}$ is divisible by 2017. Then $dwrfcxplib_{oqdmlhypxz}$ equals $2017^{|oqdmlhypxz|-1}$\nunless for each part $uoehslvkqr$ of $oqdmlhypxz$, the sum $\\sum_{hjgrkslaem \\in uoehslvkqr} tgmqnsheva_{hjgrkslaem}$ vanishes; in that case,\n$dwrfcxplib_{oqdmlhypxz}$ instead equals $2017^{|oqdmlhypxz|}$.\nSince $tgmqnsheva_0, \\dots, tgmqnsheva_{63}$ are positive integers which sum to $1 + \\frac{63 \\cdot 64}{2} = 2017$, the second outcome only occurs for $oqdmlhypxz = oqdmlhypxz_1$. By inclusion-exclusion, the desired count may be written as \n\\[\n\\sum_{oqdmlhypxz} scfyhgznpl_{oqdmlhypxz} dwrfcxplib_{oqdmlhypxz} = 2016 \\cdot scfyhgznpl_{oqdmlhypxz_1} + \\sum_{oqdmlhypxz} scfyhgznpl_{oqdmlhypxz} 2017^{|oqdmlhypxz|-1}.\n\\]\nSimilarly, the number of ordered 64-tuples with no repeated elements may be written as\n\\[\n64! \\binom{2017}{64} = \\sum_{oqdmlhypxz} scfyhgznpl_{oqdmlhypxz} 2017^{|oqdmlhypxz|}.\n\\]\nThe desired quantity may thus be written as $\\frac{2016!}{1953!} + 2016 \\, scfyhgznpl_{oqdmlhypxz_1}$.\n\nIt remains to compute $scfyhgznpl_{oqdmlhypxz_1}$. We adopt an approach suggested by David Savitt: apply inclusion-exclusion\nto count distinct 64-tuples in an \\emph{arbitrary} set $zmikgtrpwa$. As above, this yields\n\\[\n|zmikgtrpwa|(|zmikgtrpwa|-1) \\cdots (|zmikgtrpwa|-63) = \\sum_{oqdmlhypxz} scfyhgznpl_{oqdmlhypxz} |zmikgtrpwa|^{|oqdmlhypxz|}.\n\\]\nViewing both sides as polynomials in $|zmikgtrpwa|$ and comparing coefficients in degree 1 yields\n$scfyhgznpl_{oqdmlhypxz} = -63!$ and thus the claimed answer.\n\n\\noindent\n\\textbf{Second solution.}\n(from Art of Problem Solving, user \\texttt{ABCDE})\nWe first prove an auxiliary result. \n\\begin{lemma*}\nFix a prime $ybncjqfhdu$ and define the function $aslvkmnweq(vczmbtnrha)$ on positive integers by the conditions\n\\begin{align*}\naslvkmnweq(1,ybncjqfhdu) &= 0 \\\\\naslvkmnweq(vczmbtnrha,ybncjqfhdu) &= \\frac{(ybncjqfhdu-1)!}{(ybncjqfhdu-vczmbtnrha)!} - vczmbtnrha\\,aslvkmnweq(vczmbtnrha-1,ybncjqfhdu) \\qquad (vczmbtnrha>1).\n\\end{align*}\nThen for any positive integers $htewpsfivg_1,\\dots,htewpsfivg_{vczmbtnrha}$ with\n$htewpsfivg_1 + \\cdots + htewpsfivg_{vczmbtnrha} < ybncjqfhdu$, there are exactly $aslvkmnweq(ybncjqfhdu)$ solutions to the equation $htewpsfivg_1 qzxwvtnpio_1 + \\cdots + htewpsfivg_{vczmbtnrha} qzxwvtnpio_{vczmbtnrha} = 0$\nwith $qzxwvtnpio_1,\\dots,qzxwvtnpio_{vczmbtnrha} \\in \\mathbb{F}_{ybncjqfhdu}$ nonzero and pairwise distinct.\n\\end{lemma*}\n\\begin{proof}\nWe check the claim by induction, with the base case $vczmbtnrha=1$ being obvious.\nFor the induction step, assume the claim for $vczmbtnrha-1$.\nLet $uoehslvkqr$ be the set of $vczmbtnrha$-tuples of distinct elements of $\\mathbb{F}_{ybncjqfhdu}$;\nit consists of $\\frac{ybncjqfhdu!}{(ybncjqfhdu-vczmbtnrha)!}$ elements.\nThis set is stable under the action of $hjgrkslaem \\in \\mathbb{F}_{ybncjqfhdu}$ by translation:\n\\[\n(qzxwvtnpio_1,\\dots,qzxwvtnpio_{vczmbtnrha}) \\mapsto (qzxwvtnpio_1 + hjgrkslaem, \\dots, qzxwvtnpio_{vczmbtnrha} + hjgrkslaem).\n\\]\nSince $0 < htewpsfivg_1 \\cdots + htewpsfivg_{vczmbtnrha} < ybncjqfhdu$, exactly one element of each orbit gives a solution of\n$htewpsfivg_1 qzxwvtnpio_1 + \\cdots + htewpsfivg_{vczmbtnrha} qzxwvtnpio_{vczmbtnrha} = 0$. Each of these solutions contributes to $aslvkmnweq(vczmbtnrha)$ except\nfor those in which $qzxwvtnpio_{hjgrkslaem} = 0$ for some $hjgrkslaem$.\nSince then $qzxwvtnpio_{prxdluwocb} \\neq 0$ for all $prxdluwocb \\neq hjgrkslaem$, we may apply the induction hypothesis to see that there are\n$aslvkmnweq(vczmbtnrha-1,ybncjqfhdu)$ solutions that arise this way for a given $hjgrkslaem$ (and these do not overlap).\nThis proves the claim.\n\\end{proof}\n\nTo compute $aslvkmnweq(vczmbtnrha,ybncjqfhdu)$ explicitly, it is convenient to work with the auxiliary function\n\\[\nkzrtjqmnob(vczmbtnrha,ybncjqfhdu) = \\frac{ybncjqfhdu\\, aslvkmnweq(vczmbtnrha,ybncjqfhdu)}{vczmbtnrha!};\n\\]\nby the lemma, this satisfies $kzrtjqmnob(1,ybncjqfhdu) = 0$ and \n\\begin{align*}\nkzrtjqmnob(vczmbtnrha,ybncjqfhdu) &= \\binom{ybncjqfhdu}{vczmbtnrha} - kzrtjqmnob(vczmbtnrha-1,ybncjqfhdu)  \\\\\n&= \\binom{ybncjqfhdu-1}{vczmbtnrha} + \\binom{ybncjqfhdu-1}{vczmbtnrha-1} - kzrtjqmnob(vczmbtnrha-1, ybncjqfhdu) \\qquad (vczmbtnrha>1).\n\\end{align*}\nBy induction on $vczmbtnrha$, we deduce that\n\\begin{align*}\nkzrtjqmnob(vczmbtnrha,ybncjqfhdu) - \\binom{ybncjqfhdu-1}{vczmbtnrha} &= (-1)^{vczmbtnrha-1} \\left( kzrtjqmnob(1,ybncjqfhdu) - \\binom{ybncjqfhdu-1}{1} \\right) \\\\\n &= (-1)^{vczmbtnrha} (ybncjqfhdu-1)\n\\end{align*}\nand hence\n$kzrtjqmnob(vczmbtnrha,ybncjqfhdu) = \\binom{ybncjqfhdu-1}{vczmbtnrha} + (-1)^{vczmbtnrha} (ybncjqfhdu-1)$.\n\nWe now set $ybncjqfhdu=2017$ and count the tuples in question.\nDefine $tgmqnsheva_0,\\dots,tgmqnsheva_{63}$ as in the first solution. Since $tgmqnsheva_0 + \\cdots + tgmqnsheva_{63} = ybncjqfhdu$,\nthe translation action of $\\mathbb{F}_{ybncjqfhdu}$ preserves the set of tuples; we may thus assume without loss of generality\nthat $qzxwvtnpio_0 = 0$ and multiply the count by $ybncjqfhdu$ at the end. That is, the desired answer is\n\\begin{align*}\n2017\\, aslvkmnweq(63, 2017) &= 63!\\, kzrtjqmnob(63, 2017) \\\\\n& = 63! \\left( \\binom{2016}{63} - 2016 \\right)\n\\end{align*}\nas claimed.\n"
    },
    "kernel_variant": {
      "question": "Let $p$ be a prime with $p>2415$ and work throughout in the field $\\mathbb{F}_{p}$.  \n\nDefine  \n\\[\nn:=70,\\qquad   \nc_i:=i+1\\;(0\\le i\\le 68),\\qquad   \nc_{69}:=-\\sum_{i=0}^{68}c_i=-\\frac{69\\cdot 70}{2}\\equiv p-2415\\pmod{p}.\n\\]\nSince $\\displaystyle\\sum_{i=0}^{69}c_i\\equiv 0\\pmod{p}$, the linear form  \n\\[\n\\Lambda(x_0,\\ldots ,x_{69}):=\\sum_{i=0}^{69}c_i\\,x_i\\in\\mathbb{F}_{p}\n\\]\nis translation–invariant in the sense that  \n\\[\n\\Lambda(x_0+t,\\ldots ,x_{69}+t)=\\Lambda(x_0,\\ldots ,x_{69})\\qquad(\\forall\\,t\\in\\mathbb{F}_{p}).\n\\]\n\nPut  \n\\[\nN(p):=\\#\\Bigl\\{(x_0,\\ldots ,x_{69})\\in\\mathbb{F}_{p}^{\\,70}\\;;\\;\nx_0,\\ldots ,x_{69}\\text{ pairwise distinct and }\\Lambda(x_0,\\ldots ,x_{69})=0\\Bigr\\}.\n\\]\n\n1.  Prove that $N(p)$ can be expressed \\emph{without any summation symbols} as a rational polynomial in the single variable $p$.  \n\n2.  Write this closed formula explicitly for the concrete prime $p=5737$.  \n\nAll algebraic manipulations take place in $\\mathbb{F}_{p}$, whereas factorials and divisibility statements live in $\\mathbb{Z}$.",
      "solution": "Throughout let $p>2415$ be prime and work inside $\\mathbb{F}_{p}$.\n\n\\textbf{Step 1.  Removing the global translation.}  \nBecause $\\sum_{i=0}^{69}c_i\\equiv 0$, the map  \n\\[\nT_t:\\;(x_0,\\ldots ,x_{69})\\longmapsto (x_0+t,\\ldots ,x_{69}+t),\\qquad\nt\\in\\mathbb{F}_{p},\n\\]\nsends admissible $70$–tuples to admissible $70$–tuples.  \nThe action is \\emph{free}: if $T_t(x)=x$ for one admissible $x$, then\n$x_i+t=x_i$ for every $i$, whence $t=0$ because the coordinates are pairwise distinct.  \nConsequently each orbit consists of exactly $p$ tuples, and every orbit contains\na unique tuple whose last coordinate equals $0$.  Hence\n\\[\nN(p)=p\\,M(p),\n\\]\nwhere\n\\[\nM(p):=\\#\\Bigl\\{(y_1,\\ldots ,y_{69})\\in\\mathbb{F}_{p}^{\\,69}\\;;\\;\ny_1,\\ldots ,y_{69}\\text{ pairwise distinct},\\;\ny_i\\neq 0,\\;\n\\sum_{j=1}^{69}j\\,y_j=0\\Bigr\\}.\n\\]\n(The variables have been relabelled so that $y_j:=x_j-x_{69}$ for $1\\le j\\le 69$.)\n\n\\textbf{Step 2.  A uniform counting lemma.}\n\n\\medskip\n\\noindent\\emph{Lemma 1.}  \nFix $k\\ge 1$ and distinct, non–zero integers $a_1,\\dots ,a_k$ with\n\\[\na_1+\\dots +a_k< p .\n\\]\nSet\n\\[\nF_{a}(k,p):=\n\\#\\Bigl\\{(z_1,\\ldots ,z_k)\\in\\mathbb{F}_{p}^{\\,k}\\;;\\;\nz_1,\\dots ,z_k\\text{ pairwise distinct},\\;\nz_i\\neq 0,\\;\n\\sum_{j=1}^{k}a_jz_j=0\\Bigr\\}.\n\\]\nThen $F_{a}(k,p)$ depends on $k$ and $p$ only; more precisely\n\\[\nF_{a}(k,p)=f(k,p)\\qquad\\bigl(\\text{defined below, independent of }(a_j)\\bigr).\n\\]\n\n\\emph{Proof of Lemma 1.}  \nLet\n\\[\nS_k:=\\Bigl\\{(z_1,\\dots ,z_k)\\in\\mathbb{F}_{p}^{\\,k}\\;;\\;\nz_1,\\dots ,z_k\\text{ pairwise distinct}\\Bigr\\},\n\\qquad |S_k|=\\frac{p!}{(p-k)!}.\n\\]\nThe additive group $\\mathbb{F}_{p}$ acts freely on $S_k$ by simultaneous translation.\nBecause $\\sum_{j=1}^{k}a_j< p$, every orbit contains \\emph{exactly one} element that satisfies\n$\\sum_{j=1}^{k}a_jz_j=0$ (solve for the translation parameter).\nTherefore\n\\[\nF_{a}(k,p)=\\frac{1}{p}\\,\\frac{p!}{(p-k)!}-\\#\\{\\text{solutions with some }z_i=0\\}.\n\\tag{2.1}\n\\]\nAssume $z_i=0$ for a fixed index $i$.  Deleting this coordinate produces a $(k-1)$–tuple\nof pairwise distinct, non–zero entries that solves\n\\[\n\\sum_{j\\neq i}a_jz_j=0.\n\\]\nThe new coefficient list still sums to $<p$, hence the induction hypothesis applies and the\nnumber of such $(k-1)$–tuples equals $f(k-1,p)$, where $f(\\bullet,p)$ will be defined momentarily.\nSince the $k$ different indices $i$ lead to disjoint sets of solutions,\n\\[\n\\#\\{\\text{solutions with some }z_i=0\\}=k\\,f(k-1,p).\n\\]\nInsert this into (2.1) and \\emph{define}\n\\[\nf(k,p):=\\frac{(p-1)!}{(p-k)!}-k\\,f(k-1,p),\\qquad f(1,p):=0.\n\\tag{2.2}\n\\]\nThis proves the lemma. \\hfill$\\square$\n\n\\medskip\nApplying Lemma 1 with $a_j=j$ gives\n\\[\nM(p)=f(69,p).\n\\]\n\n\\textbf{Step 3.  Solving the recursion for $f(k,p)$.}  \nIntroduce\n\\[\ng(k,p):=\\frac{p\\,f(k,p)}{k!}\\qquad(k\\ge 1).\n\\]\nMultiply (2.2) by $p/k!$ to obtain\n\\[\ng(k,p)=\\binom{p}{k}-g(k-1,p),\\qquad g(1,p)=0.\n\\tag{3.1}\n\\]\nUsing $\\binom{p}{k}=\\binom{p-1}{k}+\\binom{p-1}{k-1}$ and induction on $k$ gives\n\\[\ng(k,p)=\\binom{p-1}{k}+(-1)^{k}(p-1)\\qquad(1\\le k<p).\n\\tag{3.2}\n\\]\nUndoing the definitions and putting $k=69$ yields\n\\[\nf(69,p)=\\frac{69!}{p}\\Bigl(\\binom{p-1}{69}-(p-1)\\Bigr).\n\\tag{3.3}\n\\]\n\n\\textbf{Step 4.  The closed formula for $N(p)$.}  \nBecause $N(p)=p\\,f(69,p)$, equation (3.3) implies\n\\[\n\\boxed{\\,N(p)=69!\\,\\Bigl(\\binom{p-1}{69}-(p-1)\\Bigr)\\,}.\n\\]\nThe binomial coefficient is a degree–$69$ polynomial in $p$, so $N(p)$ is\nindeed a polynomial in $p$ containing no summation symbols, settling part 1.\n\n\\textbf{Step 5.  Evaluation at $p=5737$.}  \nFor $p=5737>2415$ the same formula gives\n\\[\n\\boxed{\\,N(5737)=69!\\,\\Bigl(\\binom{5736}{69}-5736\\Bigr)\\,}.\n\\]\nWriting out the $310$-digit decimal expansion is straightforward but omitted.\n\n\\bigskip",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T19:09:31.847863",
        "was_fixed": false,
        "difficulty_analysis": "1. Multiple interacting constraints.  \n   • The original problem imposed one linear congruence; the new variant imposes \\emph{three independent} congruences, forcing the solver to keep track of a 3-dimensional orthogonality condition.  \n2. Higher-degree coefficient structure.  \n   • Coefficients now involve first, second and third powers, so verifying linear independence and the “null–part” behaviour requires familiarity with Vandermonde‐type arguments and polynomial identities over finite fields.  \n3. Extended inclusion–exclusion.  \n   • The Möbius-inversion method must be carried out in codimension 3, producing an alternating sum with quartic leading term instead of the simple binomial correction in the original.  \n4. Translation symmetry used in tandem with rank considerations.  \n   • Exploiting the row-sum-zero property simultaneously for three equations is subtler; it demands a clear distinction between free variables and those annihilated by all three coefficient rows.  \n5. Final expression involves several layers of combinatorial identities (falling factorials, binomial expansions, Stirling numbers), far beyond the single alternating correction term needed before.  \n\nCollectively these additions raise the algebraic, combinatorial and conceptual load well above that of the original kernel variant, ensuring the problem’s markedly higher difficulty."
      }
    },
    "original_kernel_variant": {
      "question": "Let $p$ be a prime with $p>2415$ and work throughout in the field $\\mathbb{F}_{p}$.  \n\nDefine  \n\\[\nn:=70,\\qquad   \nc_i:=i+1\\;(0\\le i\\le 68),\\qquad   \nc_{69}:=-\\sum_{i=0}^{68}c_i=-\\frac{69\\cdot 70}{2}\\equiv p-2415\\pmod{p}.\n\\]\nSince $\\displaystyle\\sum_{i=0}^{69}c_i\\equiv 0\\pmod{p}$, the linear form  \n\\[\n\\Lambda(x_0,\\ldots ,x_{69}):=\\sum_{i=0}^{69}c_i\\,x_i\\in\\mathbb{F}_{p}\n\\]\nis translation–invariant in the sense that  \n\\[\n\\Lambda(x_0+t,\\ldots ,x_{69}+t)=\\Lambda(x_0,\\ldots ,x_{69})\\qquad(\\forall\\,t\\in\\mathbb{F}_{p}).\n\\]\n\nPut  \n\\[\nN(p):=\\#\\Bigl\\{(x_0,\\ldots ,x_{69})\\in\\mathbb{F}_{p}^{\\,70}\\;;\\;\nx_0,\\ldots ,x_{69}\\text{ pairwise distinct and }\\Lambda(x_0,\\ldots ,x_{69})=0\\Bigr\\}.\n\\]\n\n1.  Prove that $N(p)$ can be expressed \\emph{without any summation symbols} as a rational polynomial in the single variable $p$.  \n\n2.  Write this closed formula explicitly for the concrete prime $p=5737$.  \n\nAll algebraic manipulations take place in $\\mathbb{F}_{p}$, whereas factorials and divisibility statements live in $\\mathbb{Z}$.",
      "solution": "Throughout let $p>2415$ be prime and work inside $\\mathbb{F}_{p}$.\n\n\\textbf{Step 1.  Removing the global translation.}  \nBecause $\\sum_{i=0}^{69}c_i\\equiv 0$, the map  \n\\[\nT_t:\\;(x_0,\\ldots ,x_{69})\\longmapsto (x_0+t,\\ldots ,x_{69}+t),\\qquad\nt\\in\\mathbb{F}_{p},\n\\]\nsends admissible $70$–tuples to admissible $70$–tuples.  \nThe action is \\emph{free}: if $T_t(x)=x$ for one admissible $x$, then\n$x_i+t=x_i$ for every $i$, whence $t=0$ because the coordinates are pairwise distinct.  \nConsequently each orbit consists of exactly $p$ tuples, and every orbit contains\na unique tuple whose last coordinate equals $0$.  Hence\n\\[\nN(p)=p\\,M(p),\n\\]\nwhere\n\\[\nM(p):=\\#\\Bigl\\{(y_1,\\ldots ,y_{69})\\in\\mathbb{F}_{p}^{\\,69}\\;;\\;\ny_1,\\ldots ,y_{69}\\text{ pairwise distinct},\\;\ny_i\\neq 0,\\;\n\\sum_{j=1}^{69}j\\,y_j=0\\Bigr\\}.\n\\]\n(The variables have been relabelled so that $y_j:=x_j-x_{69}$ for $1\\le j\\le 69$.)\n\n\\textbf{Step 2.  A uniform counting lemma.}\n\n\\medskip\n\\noindent\\emph{Lemma 1.}  \nFix $k\\ge 1$ and distinct, non–zero integers $a_1,\\dots ,a_k$ with\n\\[\na_1+\\dots +a_k< p .\n\\]\nSet\n\\[\nF_{a}(k,p):=\n\\#\\Bigl\\{(z_1,\\ldots ,z_k)\\in\\mathbb{F}_{p}^{\\,k}\\;;\\;\nz_1,\\dots ,z_k\\text{ pairwise distinct},\\;\nz_i\\neq 0,\\;\n\\sum_{j=1}^{k}a_jz_j=0\\Bigr\\}.\n\\]\nThen $F_{a}(k,p)$ depends on $k$ and $p$ only; more precisely\n\\[\nF_{a}(k,p)=f(k,p)\\qquad\\bigl(\\text{defined below, independent of }(a_j)\\bigr).\n\\]\n\n\\emph{Proof of Lemma 1.}  \nLet\n\\[\nS_k:=\\Bigl\\{(z_1,\\dots ,z_k)\\in\\mathbb{F}_{p}^{\\,k}\\;;\\;\nz_1,\\dots ,z_k\\text{ pairwise distinct}\\Bigr\\},\n\\qquad |S_k|=\\frac{p!}{(p-k)!}.\n\\]\nThe additive group $\\mathbb{F}_{p}$ acts freely on $S_k$ by simultaneous translation.\nBecause $\\sum_{j=1}^{k}a_j< p$, every orbit contains \\emph{exactly one} element that satisfies\n$\\sum_{j=1}^{k}a_jz_j=0$ (solve for the translation parameter).\nTherefore\n\\[\nF_{a}(k,p)=\\frac{1}{p}\\,\\frac{p!}{(p-k)!}-\\#\\{\\text{solutions with some }z_i=0\\}.\n\\tag{2.1}\n\\]\nAssume $z_i=0$ for a fixed index $i$.  Deleting this coordinate produces a $(k-1)$–tuple\nof pairwise distinct, non–zero entries that solves\n\\[\n\\sum_{j\\neq i}a_jz_j=0.\n\\]\nThe new coefficient list still sums to $<p$, hence the induction hypothesis applies and the\nnumber of such $(k-1)$–tuples equals $f(k-1,p)$, where $f(\\bullet,p)$ will be defined momentarily.\nSince the $k$ different indices $i$ lead to disjoint sets of solutions,\n\\[\n\\#\\{\\text{solutions with some }z_i=0\\}=k\\,f(k-1,p).\n\\]\nInsert this into (2.1) and \\emph{define}\n\\[\nf(k,p):=\\frac{(p-1)!}{(p-k)!}-k\\,f(k-1,p),\\qquad f(1,p):=0.\n\\tag{2.2}\n\\]\nThis proves the lemma. \\hfill$\\square$\n\n\\medskip\nApplying Lemma 1 with $a_j=j$ gives\n\\[\nM(p)=f(69,p).\n\\]\n\n\\textbf{Step 3.  Solving the recursion for $f(k,p)$.}  \nIntroduce\n\\[\ng(k,p):=\\frac{p\\,f(k,p)}{k!}\\qquad(k\\ge 1).\n\\]\nMultiply (2.2) by $p/k!$ to obtain\n\\[\ng(k,p)=\\binom{p}{k}-g(k-1,p),\\qquad g(1,p)=0.\n\\tag{3.1}\n\\]\nUsing $\\binom{p}{k}=\\binom{p-1}{k}+\\binom{p-1}{k-1}$ and induction on $k$ gives\n\\[\ng(k,p)=\\binom{p-1}{k}+(-1)^{k}(p-1)\\qquad(1\\le k<p).\n\\tag{3.2}\n\\]\nUndoing the definitions and putting $k=69$ yields\n\\[\nf(69,p)=\\frac{69!}{p}\\Bigl(\\binom{p-1}{69}-(p-1)\\Bigr).\n\\tag{3.3}\n\\]\n\n\\textbf{Step 4.  The closed formula for $N(p)$.}  \nBecause $N(p)=p\\,f(69,p)$, equation (3.3) implies\n\\[\n\\boxed{\\,N(p)=69!\\,\\Bigl(\\binom{p-1}{69}-(p-1)\\Bigr)\\,}.\n\\]\nThe binomial coefficient is a degree–$69$ polynomial in $p$, so $N(p)$ is\nindeed a polynomial in $p$ containing no summation symbols, settling part 1.\n\n\\textbf{Step 5.  Evaluation at $p=5737$.}  \nFor $p=5737>2415$ the same formula gives\n\\[\n\\boxed{\\,N(5737)=69!\\,\\Bigl(\\binom{5736}{69}-5736\\Bigr)\\,}.\n\\]\nWriting out the $310$-digit decimal expansion is straightforward but omitted.\n\n\\bigskip",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T01:37:45.649262",
        "was_fixed": false,
        "difficulty_analysis": "1. Multiple interacting constraints.  \n   • The original problem imposed one linear congruence; the new variant imposes \\emph{three independent} congruences, forcing the solver to keep track of a 3-dimensional orthogonality condition.  \n2. Higher-degree coefficient structure.  \n   • Coefficients now involve first, second and third powers, so verifying linear independence and the “null–part” behaviour requires familiarity with Vandermonde‐type arguments and polynomial identities over finite fields.  \n3. Extended inclusion–exclusion.  \n   • The Möbius-inversion method must be carried out in codimension 3, producing an alternating sum with quartic leading term instead of the simple binomial correction in the original.  \n4. Translation symmetry used in tandem with rank considerations.  \n   • Exploiting the row-sum-zero property simultaneously for three equations is subtler; it demands a clear distinction between free variables and those annihilated by all three coefficient rows.  \n5. Final expression involves several layers of combinatorial identities (falling factorials, binomial expansions, Stirling numbers), far beyond the single alternating correction term needed before.  \n\nCollectively these additions raise the algebraic, combinatorial and conceptual load well above that of the original kernel variant, ensuring the problem’s markedly higher difficulty."
      }
    }
  },
  "checked": true,
  "problem_type": "calculation"
}