{
  "index": "2011-B-6",
  "type": "NT",
  "tag": [
    "NT",
    "COMB",
    "ALG"
  ],
  "difficulty": "",
  "question": "Let $p$ be an odd prime. Show that for at least $(p+1)/2$ values of $n$ in $\\{0,1,2,\\dots,p-1\\}$,\n\\[\n\\sum_{k=0}^{p-1} k! n^k \\qquad \\mbox{is not divisible by $p$.}\n\\]\n\n\\end{itemize}\n\n\\end{document}",
  "solution": "In order to interpret the problem statement, one must choose a convention for the value of $0^0$; we will take\nit to equal 1. (If one takes $0^0$ to be 0, then the problem fails for $p=3$.)\n\n\\textbf{First solution.}\nBy Wilson's theorem,\n\\[\nk! (p-1-k)! \\equiv (-1)^{k} (p-1)! \\equiv (-1)^{k+1} \\pmod{p},\n\\]\nso we have a congruence of Laurent polynomials\n\\begin{align*}\n\\sum_{k=0}^{p-1} k! x^k &\\equiv \\sum_{k=0}^{p-1} \\frac{(-1)^{k+1} x^k}{(p-1-k)!} \\pmod{p} \\\\\n&\\equiv -x^{p-1} \\sum_{k=0}^{p-1} \\frac{(-x)^{-k}}{k!} \\pmod{p}.\n\\end{align*}\nReplacing $x$ with $-1/x$, we reduce the original problem to showing that the polynomial\n\\[\ng(x) = \\sum_{k=0}^{p-1} \\frac{x^k}{k!}\n\\]\nover $\\FF_p$ has at most $(p-1)/2$ nonzero roots in $\\FF_p$. To see this, write\n\\[\nh(x) = x^p - x + g(x)\n\\]\nand note that by Wilson's theorem again,\n\\[\nh'(x) = 1 + \\sum_{k=1}^{p-1} \\frac{x^{k-1}}{(k-1)!} = x^{p-1} - 1 + g(x).\n\\]\nIf $z \\in \\FF_p$ is such that $g(z) = 0$, then $z \\neq 0$ because $g(0) = 1$.\nTherefore, $z^{p-1} = 1$, so $h(z) = h'(z) = 0$ and so $z$ is at least a double root of $h$.\nSince $h$ is a polynomial of degree $p$, there can be at most $(p-1)/2$ zeroes of $g$ in $\\FF_p$, as desired.\n\n\\noindent\n\\textbf{Second solution.} (By Noam Elkies)\nDefine the polynomial $f$ over $\\FF_p$ by\n\\[\nf(x) = \\sum_{k=0}^{p-1} k! x^k.\n\\]\nPut $t = (p-1)/2$; the problem statement is that $f$\nhas at most $t$ roots modulo $p$.\nSuppose the contrary; since $f(0) = 1$,\nthis means that $f(x)$ is nonzero for at most $t-1$ values of $x \\in \\FF_p^*$.\nDenote these values by $x_1,\\dots,x_m$, where by assumption $m < t$, and define the polynomial\n$Q$ over $\\FF_p$ by\n\\[\nQ(x) =\n\\prod_{k=1}^m (x - x_m) = \\sum_{k=0}^{t-1} Q_k x^k.\n\\]\nThen we can write\n\\[\nf(x) = \\frac{P(x)}{Q(x)} (1-x^{p-1})\n\\]\nwhere $P(x)$ is some polynomial of degree at most $m$.\nThis means that the power series expansions of $f(x)$ and $P(x)/Q(x)$ coincide modulo $x^{p-1}$,\nso the coefficients of $x^t, \\dots, x^{2t-1}$ in $f(x) Q(x)$ vanish.\nIn other words, the product of the square matrix\n\\[\nA = ((i+j+1)!)_{i,j=0}^{t-1}\n\\]\nwith the nonzero column vector $(Q_{t-1}, \\dots, Q_0)$ is zero.\nHowever, by the following lemma, $\\det(A)$ is nonzero modulo $p$, a contradiction.\n\n\\begin{lemma}\nFor any nonnegative integer $m$ and any integer $n$,\n\\[\n\\det((i+j+n)!)_{i,j=0}^m = \\prod_{k=0}^m k! (k+n)!.\n\\]\n\\end{lemma}\n\\begin{proof}\nDefine the $(m+1) \\times (m+1)$ matrix $A_{m,n}$ by $(A_{m,n})_{i,j} = \\binom{i+j+n}{i}$;\nthe desired result is then that $\\det(A_{m,n}) = 1$. Note that\n\\[\n(A_{m,n-1})_{ij} = \\begin{cases}\n(A_{m,n})_{ij} & i=0 \\\\\n(A_{m,n})_{ij} - (A_{m,n})_{(i-1)j} & i > 0;\n\\end{cases}\n\\]\nthat is, $A_{m,n-1}$ can be obtained from $A_{m,n}$ by elementary row operations.\nTherefore, $\\det(A_{m,n}) = \\det(A_{m,n-1})$, so $\\det(A_{m,n})$ depends only on $m$.\nThe claim now follows by observing that $A_{0,0}$ is the $1 \\times 1$ matrix with entry 1\nand that $A_{m,-1}$ has the block representation $\\begin{pmatrix} 1 & * \\\\ 0 & A_{m-1,0} \\end{pmatrix}$.\n\\end{proof}\n\n\\noindent\n\\textbf{Remark.}\nElkies has given a more detailed discussion of the origins of this solution in the theory of orthogonal\npolynomials; see \\texttt{http://mathoverflow.net/questions/82648}.\n\n\n\\end{itemize}\n\\end{document}",
  "vars": [
    "i",
    "j",
    "k",
    "n",
    "x",
    "x_1",
    "x_m",
    "z"
  ],
  "params": [
    "A",
    "P",
    "Q",
    "f",
    "g",
    "h",
    "m",
    "p",
    "t"
  ],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "i": "indexi",
        "j": "indexj",
        "k": "indexk",
        "n": "indexn",
        "x": "variablex",
        "x_1": "firstx",
        "x_m": "terminalx",
        "z": "variablez",
        "A": "matrixa",
        "P": "polynomialp",
        "Q": "polynomialq",
        "f": "polynomialf",
        "g": "polynomialg",
        "h": "polynomialh",
        "m": "paramm",
        "p": "primep",
        "t": "paramt"
      },
      "question": "Let $primep$ be an odd prime. Show that for at least $(primep+1)/2$ values of $indexn$ in $\\{0,1,2,\\dots,primep-1\\}$,\n\\[\n\\sum_{indexk=0}^{primep-1} indexk!\\, indexn^{indexk} \\qquad \\mbox{is not divisible by $primep$.}\n\\]",
      "solution": "In order to interpret the problem statement, one must choose a convention for the value of $0^0$; we will take\nit to equal 1. (If one takes $0^0$ to be 0, then the problem fails for $primep=3$.)\n\n\\textbf{First solution.}\nBy Wilson's theorem,\n\\[\nindexk!\\,(primep-1-indexk)! \\equiv (-1)^{indexk} (primep-1)! \\equiv (-1)^{indexk+1} \\pmod{primep},\n\\]\nso we have a congruence of Laurent polynomials\n\\begin{align*}\n\\sum_{indexk=0}^{primep-1} indexk!\\, \\variablex^{indexk} &\\equiv \\sum_{indexk=0}^{primep-1} \\frac{(-1)^{indexk+1}\\, \\variablex^{indexk}}{(primep-1-indexk)!} \\pmod{primep} \\\\\n&\\equiv -\\variablex^{primep-1} \\sum_{indexk=0}^{primep-1} \\frac{(-\\variablex)^{-indexk}}{indexk!} \\pmod{primep}.\n\\end{align*}\nReplacing $\\variablex$ with $-1/\\variablex$, we reduce the original problem to showing that the polynomial\n\\[\npolynomialg(\\variablex) = \\sum_{indexk=0}^{primep-1} \\frac{\\variablex^{indexk}}{indexk!}\n\\]\nover $\\FF_{primep}$ has at most $(primep-1)/2$ nonzero roots in $\\FF_{primep}$. To see this, write\n\\[\npolynomialh(\\variablex) = \\variablex^{primep} - \\variablex + polynomialg(\\variablex)\n\\]\nand note that by Wilson's theorem again,\n\\[\npolynomialh'(\\variablex) = 1 + \\sum_{indexk=1}^{primep-1} \\frac{\\variablex^{indexk-1}}{(indexk-1)!} = \\variablex^{primep-1} - 1 + polynomialg(\\variablex).\n\\]\nIf $\\variablez \\in \\FF_{primep}$ is such that $polynomialg(\\variablez) = 0$, then $\\variablez \\neq 0$ because $polynomialg(0) = 1$.\nTherefore, $\\variablez^{primep-1} = 1$, so $polynomialh(\\variablez) = polynomialh'(\\variablez) = 0$ and so $\\variablez$ is at least a double root of $polynomialh$.\nSince $polynomialh$ is a polynomial of degree $primep$, there can be at most $(primep-1)/2$ zeroes of $polynomialg$ in $\\FF_{primep}$, as desired.\n\n\\noindent\n\\textbf{Second solution.} (By Noam Elkies)\nDefine the polynomial $polynomialf$ over $\\FF_{primep}$ by\n\\[\npolynomialf(\\variablex) = \\sum_{indexk=0}^{primep-1} indexk!\\, \\variablex^{indexk}.\n\\]\nPut $paramt = (primep-1)/2$; the problem statement is that $polynomialf$\nhas at most $paramt$ roots modulo $primep$.\nSuppose the contrary; since $polynomialf(0) = 1$,\nthis means that $polynomialf(\\variablex)$ is nonzero for at most $paramt-1$ values of $\\variablex \\in \\FF_{primep}^*$.\nDenote these values by $firstx,\\dots,\\terminalx$, where by assumption $paramm < paramt$, and define the polynomial\n$polynomialq$ over $\\FF_{primep}$ by\n\\[\npolynomialq(\\variablex) =\n\\prod_{indexk=1}^{paramm} (\\variablex - \\terminalx) = \\sum_{indexk=0}^{paramt-1} polynomialq_{indexk}\\, \\variablex^{indexk}.\n\\]\nThen we can write\n\\[\npolynomialf(\\variablex) = \\frac{polynomialp(\\variablex)}{polynomialq(\\variablex)}\\,(1-\\variablex^{primep-1})\n\\]\nwhere $polynomialp(\\variablex)$ is some polynomial of degree at most $paramm$.\nThis means that the power series expansions of $polynomialf(\\variablex)$ and $polynomialp(\\variablex)/polynomialq(\\variablex)$ coincide modulo $\\variablex^{primep-1}$,\nso the coefficients of $\\variablex^{paramt}, \\dots, \\variablex^{2 paramt - 1}$ in $polynomialf(\\variablex)\\, polynomialq(\\variablex)$ vanish.\nIn other words, the product of the square matrix\n\\[\nmatrixa = ((indexi+indexj+1)!)_{indexi,indexj=0}^{paramt-1}\n\\]\nwith the nonzero column vector $(polynomialq_{paramt-1}, \\dots, polynomialq_0)$ is zero.\nHowever, by the following lemma, $\\det(matrixa)$ is nonzero modulo $primep$, a contradiction.\n\n\\begin{lemma}\nFor any nonnegative integer $paramm$ and any integer $indexn$,\n\\[\n\\det((indexi+indexj+indexn)!)_{indexi,indexj=0}^{paramm} = \\prod_{indexk=0}^{paramm} indexk!\\,(indexk+indexn)!.\n\\]\n\\end{lemma}\n\\begin{proof}\nDefine the $(paramm+1) \\times (paramm+1)$ matrix $matrixa_{paramm,indexn}$ by $(matrixa_{paramm,indexn})_{indexi,indexj} = \\binom{indexi+indexj+indexn}{indexi}$;\nthe desired result is then that $\\det(matrixa_{paramm,indexn}) = 1$. Note that\n\\[\n(matrixa_{paramm,indexn-1})_{indexi indexj} = \\begin{cases}\n(matrixa_{paramm,indexn})_{indexi indexj} & indexi=0 \\\\\n(matrixa_{paramm,indexn})_{indexi indexj} - (matrixa_{paramm,indexn})_{(indexi-1) indexj} & indexi > 0;\n\\end{cases}\n\\]\nthat is, $matrixa_{paramm,indexn-1}$ can be obtained from $matrixa_{paramm,indexn}$ by elementary row operations.\nTherefore, $\\det(matrixa_{paramm,indexn}) = \\det(matrixa_{paramm,indexn-1})$, so $\\det(matrixa_{paramm,indexn})$ depends only on $paramm$.\nThe claim now follows by observing that $matrixa_{0,0}$ is the $1 \\times 1$ matrix with entry 1\nand that $matrixa_{paramm,-1}$ has the block representation $\\begin{pmatrix} 1 & * \\\\ 0 & matrixa_{paramm-1,0} \\end{pmatrix}$.\n\\end{proof}\n\n\\noindent\n\\textbf{Remark.}\nElkies has given a more detailed discussion of the origins of this solution in the theory of orthogonal\npolynomials; see \\texttt{http://mathoverflow.net/questions/82648}."
    },
    "descriptive_long_confusing": {
      "map": {
        "j": "riverbank",
        "k": "cloudberry",
        "n": "hinterland",
        "x": "lighthouse",
        "x_1": "lighthouseone",
        "x_m": "lighthousemany",
        "z": "harvestmoon",
        "A": "butterbell",
        "P": "caterpillar",
        "Q": "dandelion",
        "f": "umbrella",
        "g": "snowflake",
        "h": "rainforest",
        "m": "pineapple",
        "p": "strawberry",
        "t": "milkshakes"
      },
      "question": "Let $strawberry$ be an odd prime. Show that for at least $(strawberry+1)/2$ values of $hinterland$ in $\\{0,1,2,\\dots,strawberry-1\\}$,\n\\[\n\\sum_{cloudberry=0}^{strawberry-1} cloudberry!\\,hinterland^{cloudberry} \\qquad \\mbox{is not divisible by $strawberry$.}\n\\]",
      "solution": "In order to interpret the problem statement, one must choose a convention for the value of $0^0$; we will take it to equal 1. (If one takes $0^0$ to be 0, then the problem fails for $strawberry=3$.)\n\n\\textbf{First solution.}\nBy Wilson's theorem,\n\\[\ncloudberry!\\,(strawberry-1-cloudberry)! \\equiv (-1)^{cloudberry}(strawberry-1)! \\equiv (-1)^{cloudberry+1} \\pmod{strawberry},\n\\]\nso we have a congruence of Laurent polynomials\n\\begin{align*}\n\\sum_{cloudberry=0}^{strawberry-1} cloudberry!\\,lighthouse^{cloudberry} &\\equiv \\sum_{cloudberry=0}^{strawberry-1} \\frac{(-1)^{cloudberry+1}lighthouse^{cloudberry}}{(strawberry-1-cloudberry)!} \\pmod{strawberry} \\\n&\\equiv -lighthouse^{strawberry-1} \\sum_{cloudberry=0}^{strawberry-1} \\frac{(-lighthouse)^{-cloudberry}}{cloudberry!} \\pmod{strawberry}.\n\\end{align*}\nReplacing $lighthouse$ with $-1/lighthouse$, we reduce the original problem to showing that the polynomial\n\\[\nsnowflake(lighthouse)=\\sum_{cloudberry=0}^{strawberry-1}\\frac{lighthouse^{cloudberry}}{cloudberry!}\n\\]\nover $\\FF_{strawberry}$ has at most $(strawberry-1)/2$ nonzero roots in $\\FF_{strawberry}$. To see this, write\n\\[\nrainforest(lighthouse)=lighthouse^{strawberry}-lighthouse+snowflake(lighthouse)\n\\]\nand note that by Wilson's theorem again,\n\\[\nrainforest'(lighthouse)=1+\\sum_{cloudberry=1}^{strawberry-1}\\frac{lighthouse^{cloudberry-1}}{(cloudberry-1)!}=lighthouse^{strawberry-1}-1+snowflake(lighthouse).\n\\]\nIf $harvestmoon\\in\\FF_{strawberry}$ is such that $snowflake(harvestmoon)=0$, then $harvestmoon\\neq0$ because $snowflake(0)=1$.\nTherefore, $harvestmoon^{strawberry-1}=1$, so $rainforest(harvestmoon)=rainforest'(harvestmoon)=0$ and so $harvestmoon$ is at least a double root of $rainforest$.\nSince $rainforest$ is a polynomial of degree $strawberry$, there can be at most $(strawberry-1)/2$ zeroes of $snowflake$ in $\\FF_{strawberry}$, as desired.\n\n\\noindent\n\\textbf{Second solution.} (By Noam Elkies)\nDefine the polynomial $umbrella$ over $\\FF_{strawberry}$ by\n\\[\numbrella(lighthouse)=\\sum_{cloudberry=0}^{strawberry-1} cloudberry!\\,lighthouse^{cloudberry}.\n\\]\nPut $milkshakes=(strawberry-1)/2$; the problem statement is that $umbrella$ has at most $milkshakes$ roots modulo $strawberry$.\nSuppose the contrary; since $umbrella(0)=1$, this means that $umbrella(lighthouse)$ is nonzero for at most $milkshakes-1$ values of $lighthouse\\in\\FF_{strawberry}^*$.\nDenote these values by $lighthouseone,\\dots,lighthousemany$, where by assumption $pineapple<milkshakes$, and define the polynomial $dandelion$ over $\\FF_{strawberry}$ by\n\\[\ndandelion(lighthouse)=\\prod_{cloudberry=1}^{pineapple}(lighthouse-lighthousemany)=\\sum_{cloudberry=0}^{milkshakes-1} dandelion_{cloudberry}lighthouse^{cloudberry}.\n\\]\nThen we can write\n\\[\numbrella(lighthouse)=\\frac{caterpillar(lighthouse)}{dandelion(lighthouse)}(1-lighthouse^{strawberry-1})\n\\]\nwhere $caterpillar(lighthouse)$ is some polynomial of degree at most $pineapple$.\nThis means that the power series expansions of $umbrella(lighthouse)$ and $caterpillar(lighthouse)/dandelion(lighthouse)$ coincide modulo $lighthouse^{strawberry-1}$, so the coefficients of $lighthouse^{milkshakes},\\dots,lighthouse^{2milkshakes-1}$ in $umbrella(lighthouse)dandelion(lighthouse)$ vanish.\nIn other words, the product of the square matrix\n\\[\nbutterbell=((i+riverbank+1)!)_{i,riverbank=0}^{milkshakes-1}\n\\]\nwith the nonzero column vector $(dandelion_{milkshakes-1},\\dots,dandelion_0)$ is zero.\nHowever, by the following lemma, $\\det(butterbell)$ is nonzero modulo $strawberry$, a contradiction.\n\n\\begin{lemma}\nFor any nonnegative integer $pineapple$ and any integer $hinterland$,\n\\[\n\\det((i+riverbank+hinterland)!)_{i,riverbank=0}^{pineapple}=\\prod_{cloudberry=0}^{pineapple} cloudberry!(cloudberry+hinterland)!.\n\\]\n\\end{lemma}\n\\begin{proof}\nDefine the $(pineapple+1)\\times(pineapple+1)$ matrix $A_{pineapple,hinterland}$ by $(A_{pineapple,hinterland})_{i,riverbank}=\\binom{i+riverbank+hinterland}{i}$; the desired result is then that $\\det(A_{pineapple,hinterland})=1$. Note that\n\\[\n(A_{pineapple,hinterland-1})_{i riverbank}=\\begin{cases}(A_{pineapple,hinterland})_{i riverbank}& i=0\\\\(A_{pineapple,hinterland})_{i riverbank}-(A_{pineapple,hinterland})_{(i-1) riverbank}& i>0;\\end{cases}\n\\]\nthat is, $A_{pineapple,hinterland-1}$ can be obtained from $A_{pineapple,hinterland}$ by elementary row operations.\nTherefore, $\\det(A_{pineapple,hinterland})=\\det(A_{pineapple,hinterland-1})$, so $\\det(A_{pineapple,hinterland})$ depends only on $pineapple$.\nThe claim now follows by observing that $A_{0,0}$ is the $1\\times1$ matrix with entry 1 and that $A_{pineapple,-1}$ has the block representation $\\begin{pmatrix}1 & *\\\\0 & A_{pineapple-1,0}\\end{pmatrix}$.\n\\end{proof}\n\n\\noindent\n\\textbf{Remark.}\nElkies has given a more detailed discussion of the origins of this solution in the theory of orthogonal polynomials; see \\texttt{http://mathoverflow.net/questions/82648}.\n"
    },
    "descriptive_long_misleading": {
      "map": {
        "i": "endpointvar",
        "j": "outsetvar",
        "k": "limitvalue",
        "n": "floatparam",
        "x": "steadyconst",
        "x_1": "finalplaceone",
        "x_m": "originplacem",
        "z": "unboundvar",
        "A": "scalarvar",
        "P": "reciprofunc",
        "Q": "randompoly",
        "f": "antipoly",
        "g": "staticfunc",
        "h": "restpoly",
        "m": "limitless",
        "p": "composite",
        "t": "doubleval"
      },
      "question": "Let $composite$ be an odd prime. Show that for at least $(composite+1)/2$ values of $floatparam$ in $\\{0,1,2,\\dots,composite-1\\}$,\n\\[\n\\sum_{limitvalue=0}^{composite-1} limitvalue!\\, floatparam^{limitvalue} \\qquad \\mbox{is not divisible by $composite$.}\n\\]",
      "solution": "In order to interpret the problem statement, one must choose a convention for the value of $0^0$; we will take\nit to equal 1. (If one takes $0^0$ to be 0, then the problem fails for $composite=3$.)\n\n\\textbf{First solution.}\nBy Wilson's theorem,\n\\[\nlimitvalue! (composite-1-limitvalue)! \\equiv (-1)^{limitvalue} (composite-1)! \\equiv (-1)^{limitvalue+1} \\pmod{composite},\n\\]\nso we have a congruence of Laurent polynomials\n\\begin{align*}\n\\sum_{limitvalue=0}^{composite-1} limitvalue!\\, steadyconst^{limitvalue} &\\equiv \\sum_{limitvalue=0}^{composite-1} \\frac{(-1)^{limitvalue+1} steadyconst^{limitvalue}}{(composite-1-limitvalue)!} \\pmod{composite} \\\\\n&\\equiv -steadyconst^{composite-1} \\sum_{limitvalue=0}^{composite-1} \\frac{(-steadyconst)^{-limitvalue}}{limitvalue!} \\pmod{composite}.\n\\end{align*}\nReplacing $steadyconst$ with $-1/steadyconst$, we reduce the original problem to showing that the polynomial\n\\[\nstaticfunc(steadyconst) = \\sum_{limitvalue=0}^{composite-1} \\frac{steadyconst^{limitvalue}}{limitvalue!}\n\\]\nover $\\FF_{composite}$ has at most $(composite-1)/2$ nonzero roots in $\\FF_{composite}$. To see this, write\n\\[\nrestpoly(steadyconst) = steadyconst^{composite} - steadyconst + staticfunc(steadyconst)\n\\]\nand note that by Wilson's theorem again,\n\\[\nrestpoly'(steadyconst) = 1 + \\sum_{limitvalue=1}^{composite-1} \\frac{steadyconst^{limitvalue-1}}{(limitvalue-1)!} = steadyconst^{composite-1} - 1 + staticfunc(steadyconst).\n\\]\nIf $unboundvar \\in \\FF_{composite}$ is such that $staticfunc(unboundvar) = 0$, then $unboundvar \\neq 0$ because $staticfunc(0) = 1$.\nTherefore, $unboundvar^{composite-1} = 1$, so $restpoly(unboundvar) = restpoly'(unboundvar) = 0$ and so $unboundvar$ is at least a double root of $restpoly$.\nSince $restpoly$ is a polynomial of degree $composite$, there can be at most $(composite-1)/2$ zeroes of $staticfunc$ in $\\FF_{composite}$, as desired.\n\n\\noindent\n\\textbf{Second solution.} (By Noam Elkies)\nDefine the polynomial $antipoly$ over $\\FF_{composite}$ by\n\\[\nantipoly(steadyconst) = \\sum_{limitvalue=0}^{composite-1} limitvalue!\\, steadyconst^{limitvalue}.\n\\]\nPut $doubleval = (composite-1)/2$; the problem statement is that $antipoly$\nhas at most $doubleval$ roots modulo $composite$.\nSuppose the contrary; since $antipoly(0) = 1$,\nthis means that $antipoly(steadyconst)$ is nonzero for at most $doubleval-1$ values of $steadyconst \\in \\FF_{composite}^*$.\nDenote these values by $finalplaceone,\\dots,originplacem$, where by assumption $limitless < doubleval$, and define the polynomial\n$randompoly$ over $\\FF_{composite}$ by\n\\[\nrandompoly(steadyconst) =\n\\prod_{limitvalue=1}^{limitless} (steadyconst - originplacem) = \\sum_{limitvalue=0}^{doubleval-1} randompoly_{limitvalue} \\, steadyconst^{limitvalue}.\n\\]\nThen we can write\n\\[\nantipoly(steadyconst) = \\frac{reciprofunc(steadyconst)}{randompoly(steadyconst)} (1-steadyconst^{composite-1})\n\\]\nwhere $reciprofunc(steadyconst)$ is some polynomial of degree at most $limitless$.\nThis means that the power series expansions of $antipoly(steadyconst)$ and $reciprofunc(steadyconst)/randompoly(steadyconst)$ coincide modulo $steadyconst^{composite-1}$,\nso the coefficients of $steadyconst^{doubleval}, \\dots, steadyconst^{2doubleval-1}$ in $antipoly(steadyconst)\\, randompoly(steadyconst)$ vanish.\nIn other words, the product of the square matrix\n\\[\nscalarvar = ((endpointvar+outsetvar+1)!)_{endpointvar,outsetvar=0}^{doubleval-1}\n\\]\nwith the nonzero column vector $(randompoly_{doubleval-1}, \\dots, randompoly_0)$ is zero.\nHowever, by the following lemma, $\\det(scalarvar)$ is nonzero modulo $composite$, a contradiction.\n\n\\begin{lemma}\nFor any nonnegative integer limitless and any integer floatparam,\n\\[\n\\det((endpointvar+outsetvar+floatparam)!)_{endpointvar,outsetvar=0}^{limitless} = \\prod_{limitvalue=0}^{limitless} limitvalue!\\,(limitvalue+floatparam)!.\n\\]\n\\end{lemma}\n\\begin{proof}\nDefine the $(limitless+1) \\times (limitless+1)$ matrix $scalarvar_{limitless,floatparam}$ by $(scalarvar_{limitless,floatparam})_{endpointvar,outsetvar} = \\binom{endpointvar+outsetvar+floatparam}{endpointvar}$;\nthe desired result is then that $\\det(scalarvar_{limitless,floatparam}) = 1$. Note that\n\\[\n(scalarvar_{limitless,floatparam-1})_{endpointvar,outsetvar} = \\begin{cases}\n(scalarvar_{limitless,floatparam})_{endpointvar,outsetvar} & endpointvar=0 \\\\\n(scalarvar_{limitless,floatparam})_{endpointvar,outsetvar} - (scalarvar_{limitless,floatparam})_{endpointvar-1,outsetvar} & endpointvar > 0;\n\\end{cases}\n\\]\nthat is, $scalarvar_{limitless,floatparam-1}$ can be obtained from $scalarvar_{limitless,floatparam}$ by elementary row operations.\nTherefore, $\\det(scalarvar_{limitless,floatparam}) = \\det(scalarvar_{limitless,floatparam-1})$, so $\\det(scalarvar_{limitless,floatparam})$ depends only on $limitless$.\nThe claim now follows by observing that $scalarvar_{0,0}$ is the $1 \\times 1$ matrix with entry 1\nand that $scalarvar_{limitless,-1}$ has the block representation $\\begin{pmatrix} 1 & * \\\\ 0 & scalarvar_{limitless-1,0} \\end{pmatrix}$.\n\\end{proof}\n\n\\noindent\n\\textbf{Remark.}\nElkies has given a more detailed discussion of the origins of this solution in the theory of orthogonal\npolynomials; see \\texttt{http://mathoverflow.net/questions/82648}.\n"
    },
    "garbled_string": {
      "map": {
        "i": "qzxwvtnp",
        "j": "hjgrksla",
        "k": "mnlqwert",
        "n": "vpdshfge",
        "x": "lkrtyuio",
        "x_1": "tghasdfa",
        "x_m": "bvcxzwer",
        "z": "plmoknij",
        "A": "asdfghjk",
        "P": "qwertyui",
        "Q": "zxcvbnml",
        "f": "poiulkjh",
        "g": "mnbvcxsa",
        "h": "qazwsxed",
        "m": "edcrfvtg",
        "p": "lkjhgfds",
        "t": "wsxqazpl"
      },
      "question": "Let $lkjhgfds$ be an odd prime. Show that for at least $(lkjhgfds+1)/2$ values of $vpdshfge$ in $\\{0,1,2,\\dots,lkjhgfds-1\\}$,\n\\[\n\\sum_{mnlqwert=0}^{lkjhgfds-1} mnlqwert! vpdshfge^{mnlqwert} \\qquad \\mbox{is not divisible by $lkjhgfds$.}\n\\]",
      "solution": "In order to interpret the problem statement, one must choose a convention for the value of $0^0$; we will take\nit to equal 1. (If one takes $0^0$ to be 0, then the problem fails for $lkjhgfds=3$.)\n\n\\textbf{First solution.}\nBy Wilson's theorem,\n\\[\nmnlqwert! (lkjhgfds-1-mnlqwert)! \\equiv (-1)^{mnlqwert} (lkjhgfds-1)! \\equiv (-1)^{mnlqwert+1} \\pmod{lkjhgfds},\n\\]\nso we have a congruence of Laurent polynomials\n\\begin{align*}\n\\sum_{mnlqwert=0}^{lkjhgfds-1} mnlqwert! lkrtyuio^{mnlqwert} &\\equiv \\sum_{mnlqwert=0}^{lkjhgfds-1} \\frac{(-1)^{mnlqwert+1} lkrtyuio^{mnlqwert}}{(lkjhgfds-1-mnlqwert)!} \\pmod{lkjhgfds} \\\\\n&\\equiv -lkrtyuio^{lkjhgfds-1} \\sum_{mnlqwert=0}^{lkjhgfds-1} \\frac{(-lkrtyuio)^{-mnlqwert}}{mnlqwert!} \\pmod{lkjhgfds}.\n\\end{align*}\nReplacing $lkrtyuio$ with $-1/lkrtyuio$, we reduce the original problem to showing that the polynomial\n\\[\nmnbvcxsa(lkrtyuio) = \\sum_{mnlqwert=0}^{lkjhgfds-1} \\frac{lkrtyuio^{mnlqwert}}{mnlqwert!}\n\\]\nover $\\FF_{lkjhgfds}$ has at most $(lkjhgfds-1)/2$ nonzero roots in $\\FF_{lkjhgfds}$. To see this, write\n\\[\nqazwsxed(lkrtyuio) = lkrtyuio^{lkjhgfds} - lkrtyuio + mnbvcxsa(lkrtyuio)\n\\]\nand note that by Wilson's theorem again,\n\\[\nqazwsxed'(lkrtyuio) = 1 + \\sum_{mnlqwert=1}^{lkjhgfds-1} \\frac{lkrtyuio^{mnlqwert-1}}{(mnlqwert-1)!} = lkrtyuio^{lkjhgfds-1} - 1 + mnbvcxsa(lkrtyuio).\n\\]\nIf $plmoknij \\in \\FF_{lkjhgfds}$ is such that $mnbvcxsa(plmoknij) = 0$, then $plmoknij \\neq 0$ because $mnbvcxsa(0) = 1$.\nTherefore, $plmoknij^{lkjhgfds-1} = 1$, so $qazwsxed(plmoknij) = qazwsxed'(plmoknij) = 0$ and so $plmoknij$ is at least a double root of $qazwsxed$.\nSince $qazwsxed$ is a polynomial of degree $lkjhgfds$, there can be at most $(lkjhgfds-1)/2$ zeroes of $mnbvcxsa$ in $\\FF_{lkjhgfds}$, as desired.\n\n\\noindent\n\\textbf{Second solution.} (By Noam Elkies)\nDefine the polynomial $poiulkjh$ over $\\FF_{lkjhgfds}$ by\n\\[\npoiulkjh(lkrtyuio) = \\sum_{mnlqwert=0}^{lkjhgfds-1} mnlqwert! lkrtyuio^{mnlqwert}.\n\\]\nPut $wsxqazpl = (lkjhgfds-1)/2$; the problem statement is that $poiulkjh$\nhas at most $wsxqazpl$ roots modulo $lkjhgfds$.\nSuppose the contrary; since $poiulkjh(0) = 1$,\nthis means that $poiulkjh(lkrtyuio)$ is nonzero for at most $wsxqazpl-1$ values of $lkrtyuio \\in \\FF_{lkjhgfds}^*$.\nDenote these values by $tghasdfa,\\dots,bvcxzwer$, where by assumption $edcrfvtg < wsxqazpl$, and define the polynomial\nzxcvbnml over $\\FF_{lkjhgfds}$ by\n\\[\nzxcvbnml(lkrtyuio) =\n\\prod_{mnlqwert=1}^{edcrfvtg} (lkrtyuio - bvcxzwer) = \\sum_{mnlqwert=0}^{wsxqazpl-1} zxcvbnml_{mnlqwert} lkrtyuio^{mnlqwert}.\n\\]\nThen we can write\n\\[\npoiulkjh(lkrtyuio) = \\frac{qwertyui(lkrtyuio)}{zxcvbnml(lkrtyuio)} (1-lkrtyuio^{lkjhgfds-1})\n\\]\nwhere $qwertyui(lkrtyuio)$ is some polynomial of degree at most $edcrfvtg$.\nThis means that the power series expansions of $poiulkjh(lkrtyuio)$ and $qwertyui(lkrtyuio)/zxcvbnml(lkrtyuio)$ coincide modulo $lkrtyuio^{lkjhgfds-1}$,\nso the coefficients of $lkrtyuio^{wsxqazpl}, \\dots, lkrtyuio^{2\\,wsxqazpl-1}$ in $poiulkjh(lkrtyuio) zxcvbnml(lkrtyuio)$ vanish.\nIn other words, the product of the square matrix\n\\[\nasdfghjk = ((qzxwvtnp+hjgrksla+1)!)_{qzxwvtnp,hjgrksla=0}^{wsxqazpl-1}\n\\]\nwith the nonzero column vector $(zxcvbnml_{wsxqazpl-1}, \\dots, zxcvbnml_0)$ is zero.\nHowever, by the following lemma, $\\det(asdfghjk)$ is nonzero modulo $lkjhgfds$, a contradiction.\n\n\\begin{lemma}\nFor any nonnegative integer $edcrfvtg$ and any integer $vpdshfge$,\n\\[\n\\det((qzxwvtnp+hjgrksla+vpdshfge)!)_{qzxwvtnp,hjgrksla=0}^{edcrfvtg} = \\prod_{mnlqwert=0}^{edcrfvtg} mnlqwert! (mnlqwert+vpdshfge)!.\n\\]\n\\end{lemma}\n\\begin{proof}\nDefine the $(edcrfvtg+1) \\times (edcrfvtg+1)$ matrix $asdfghjk_{edcrfvtg,vpdshfge}$ by $(asdfghjk_{edcrfvtg,vpdshfge})_{qzxwvtnp,hjgrksla} = \\binom{qzxwvtnp+hjgrksla+vpdshfge}{qzxwvtnp}$;\nthe desired result is then that $\\det(asdfghjk_{edcrfvtg,vpdshfge}) = 1$. Note that\n\\[\n(asdfghjk_{edcrfvtg,vpdshfge-1})_{qzxwvtnp,hjgrksla} = \\begin{cases}\n(asdfghjk_{edcrfvtg,vpdshfge})_{qzxwvtnp,hjgrksla} & qzxwvtnp=0 \\\\\n(asdfghjk_{edcrfvtg,vpdshfge})_{qzxwvtnp,hjgrksla} - (asdfghjk_{edcrfvtg,vpdshfge})_{(qzxwvtnp-1),hjgrksla} & qzxwvtnp > 0;\n\\end{cases}\n\\]\nthat is, $asdfghjk_{edcrfvtg,vpdshfge-1}$ can be obtained from $asdfghjk_{edcrfvtg,vpdshfge}$ by elementary row operations.\nTherefore, $\\det(asdfghjk_{edcrfvtg,vpdshfge}) = \\det(asdfghjk_{edcrfvtg,vpdshfge-1})$, so $\\det(asdfghjk_{edcrfvtg,vpdshfge})$ depends only on $edcrfvtg$.\nThe claim now follows by observing that $asdfghjk_{0,0}$ is the $1 \\times 1$ matrix with entry 1\nand that $asdfghjk_{edcrfvtg,-1}$ has the block representation $\\begin{pmatrix} 1 & * \\\\ 0 & asdfghjk_{edcrfvtg-1,0} \\end{pmatrix}$.\n\\end{proof}\n\n\\noindent\n\\textbf{Remark.}\nElkies has given a more detailed discussion of the origins of this solution in the theory of orthogonal\npolynomials; see \\texttt{http://mathoverflow.net/questions/82648}.\n"
    },
    "kernel_variant": {
      "question": "Let $p$ be an odd prime.  Prove that for at least $(p-1)/2$ distinct residues\n\\[\nS(n)= (p-1)!\\,\\sum_{k=0}^{p-1} k!\\,n^{k},\\qquad n\\in\\{1,2,\\dots ,p-1\\},\n\\]\n is \nnot divisible by $p$.",
      "solution": "We work throughout modulo p, an odd prime.  Since Wilson’s theorem says (p−1)!≡−1 (mod p), the factor (p−1)! in S(n) can never be zero modulo p, so it suffices to show that the polynomial\n\n   f(x)=∑_{k=0}^{p−1} k!·x^k  in F_p[x]\n\nhas at most (p−1)/2 roots among the nonzero residues x∈F_p^×.\n\n1.  (Laurent‐polynomial symmetry)\nBy Wilson’s theorem,\n   k!·(p−1−k)! ≡ (−1)^{k+1}  (mod p),\nso for 0≤k≤p−1 we have\n   k! ≡ (−1)^{k+1}/(p−1−k)!  (mod p).\nHence\n   f(x)≡ ∑_{k=0}^{p−1} (−1)^{k+1} x^k/(p−1−k)!\n      = −∑_{j=0}^{p−1} (−1)^j x^{p−1−j}/j!\n      = −x^{p−1}·∑_{j=0}^{p−1} (−1)^j x^{−j}/j!\n      = −x^{p−1}·g(−1/x),\nwhere we set\n   g(x)=∑_{j=0}^{p−1} x^j/j! ∈ F_p[x].\nIt follows that for every nonzero n∈F_p^×,\n   f(n)=0  ⇔  g(−1/n)=0.\nThus f and g have the same number of nonzero roots in F_p^×.\n\n2.  (Bounding the roots of g)\nDefine the degree-p polynomial\n   h(x)=x^p − x + g(x)\nover F_p.  Its formal derivative is\n   h′(x)=p·x^{p−1} − 1 + g′(x) ≡ −1 + g′(x)   (mod p).\nBut\n   g′(x)=∑_{k=1}^{p−1} k·x^{k-1}/k! = ∑_{m=0}^{p-2} x^m/m!.\nSince g(x)=∑_{m=0}^{p-1} x^m/m!, we have\n   ∑_{m=0}^{p-2} x^m/m! ≡ g(x) − x^{p-1}/(p-1)! \nand (p-1)!≡−1, so\n   g′(x) ≡ g(x) + x^{p-1}  (mod p).\nHence\n   h′(x) ≡ −1 + g(x) + x^{p-1} = x^{p-1} − 1 + g(x).\n\nNow let z∈F_p^× satisfy g(z)=0.  By Fermat’s little theorem z^{p-1}≡1, so\n   h(z)=z^p−z+g(z)=z·(z^{p-1}−1)+0=0,\n   h′(z)=z^{p-1}−1+g(z)=1−1+0=0.\nThus z is a double root of the degree-p polynomial h.  Since a degree-p polynomial over a field can have at most p/2 distinct double roots, there are at most (p−1)/2 such z.\nTherefore g has at most (p−1)/2 roots in F_p^×, and so f has at most (p−1)/2 roots in F_p^×.\n\n3.  (Conclusion)\nHence among the p−1 nonzero values n∈{1,2,…,p−1}, f(n)≠0 for at least (p−1)/2 of them.  Multiplying back by the nonzero factor (p−1)! shows S(n)≠0 (mod p) for at least (p−1)/2 choices of n, as required.",
      "_meta": {
        "core_steps": [
          "Use Wilson’s theorem:  k!(p−1−k)! ≡ (−1)^{k+1} (mod p).",
          "With this identity, substitute x↦−1/x and reduce the original series to g(x)=∑_{k=0}^{p−1} x^k / k! (mod p).",
          "Introduce h(x)=x^p−x+g(x) and compute h'(x)=x^{p−1}−1+g(x).",
          "If g(z)=0 then z≠0 and z^{p−1}=1, so h(z)=h'(z)=0; thus every root of g is a double root of h.",
          "Because h is degree p, g has ≤(p−1)/2 roots, giving ≥(p+1)/2 non-zero values of the original sum."
        ],
        "mutable_slots": {
          "slot1": {
            "description": "Whether the value n=0 is included among the tested residues (0 never contributes a root anyway).",
            "original": "n ranges over {0,1,…,p−1}"
          },
          "slot2": {
            "description": "A global non-zero scalar factor multiplying the whole series ∑ k! n^k; scaling does not affect divisibility.",
            "original": "scalar factor = 1"
          }
        }
      }
    }
  },
  "checked": true,
  "problem_type": "proof"
}