Polynomials that induce the zero function mod $n$

Edited and improved

Using the fact that the product of any $n$ consecutive integers is divisible by $n!$ we immediately get

Lemma 1 Let $R_n(X)=X(X-1)(X-2)...(X-n+1)$. Then $R(X)$ is trivial $\pmod{n!}$.

Lemma2: Let $P(X)=a_kX^k+..+a_1X+a_0$ and let $p$ be prime. If $P(X)$ is trivial modulo $p$ and $p$ does not divide all coefficients of $P(X)$ then $k \geq p$.

Proof: Since $P(X)$ has $p$ roots in the field $\ZZ_p$, it has degree at least $p$ modulo $p$. Then $k \geq p$.


As consequences we get immediately:

Lemma 3: If $p$ is prime, and $n$ is so that $p|n$ and $n |p!$ then $$ M_n=X(X-1)(X_2)...(X-p+1)=: R_p $$

[Or another polynomial of same degree, namely $M_n=R_p+Q(X)L_n(X)$ for some $Q(X)$.]

Proof: Since $n|p!$, by Lemma 1 $R_p(X) $ is trivial modulo $n$. By Lemma2, $deg(M_n) \geq p$. \qed

Lemma 4 If $p$ is the smallest prime dividing $n$, and $n$ is square free, then $$L_n=\frac{n}{p}(X^p-X)$$

Proof It is clear that this polynomial works. We show next $\deg(L_n) \geq p$.

Let $L_n=a_kX^k+....a_1X+a_0$. Take the first coefficient $a_l$ which is not divisible by $n$. Then, there exists a prime $q|n$ such that $q \nmid a_l$.

By Lemma 2$deg(L_n) \geq q \geq p$.

Final Note: Your $M_8$ is wrong. Note that if $n$ is even then $8|n(n-2)$ and if $n$ is odd $8|(n-1)(n+1)$.

I think that it is easy to show that $M_8=(X-2)(X-1)X(X+1)$ or something equivalent $\pmod{8}$. THis also works for $M_{24}$.


Not complete answers, but too large for comment. I have the results, when $n=p_1^{\alpha_1}\cdots p_{k}^{\alpha_k}$:

Non-monic case: The minimal degree is exactly $\min p_i.$

Monic case: The minimal degree is the maximum of the degrees for each $p_i^{\alpha_i}.$ The degree of $p_i^{\alpha_i}$ must be divisible by $p_i$ and is at most $\alpha_ip_i.$ This is not the absolute minimum, for example when $p=2$ and $\alpha=3,$ the minimal degree for $8$ is $4<6=p\alpha.$

My conjecture is that the minimal monic degree $d$ for $p^k$ is the smallest $d$ such that $\nu_p(d!)\geq k.$

If that is true, then if $n=p_1^{\alpha_1}\cdots p_k^{\alpha_k}$ then the minimal monic degree is the minimal $d$ such that each $p_i^{\alpha_i}$ divides $d!.$

Non-monic case:

If $d(n)$ is the smallest degree for $n$ in the non-monic case, we can get, for any $m.n,$ $d(mn)=\min(d(m),d(n)).$

This is because if $p_m(x)$ is a minimal polynomial for $m$ then we take $np_m(x).$

This means that if $n=p_1^{\alpha_1}p_2^{\alpha_2}\cdots$ then $d(n)=\min_i d\left(p_i\right).$ But when $p$ is prime, $d(p)=p,$ so we get $d(n)=\min_i p_i.$

Monic case:

If $D(n)$ is the smallest degree of a monic, then when $\gcd(m,n)=1$ you have that $D(mn)=\max (D(m),D(n)).$

This is because if $p_m,p_n$ are the corresponding monic polynomials with $D(m)\geq D(n)$ you can apply Chinese remainder theorem coefficient by coefficient to find a polynomial $P_{mn}$ so that:

$$\begin{align}P_{mn}(x)&\equiv p_m(x)\pmod{m}\\ P_{mn}(x)&\equiv x^{D(m)-D(n)}p_n(x)\pmod{n}\end{align}$$

Since both polynomials are monic and of degree equal to the $D(m),$ we get $P_{mn}$ monic and $P_{mn}(x)$ satisfies your conditions.

We also have that $D\left(p^{\alpha}\right)\leq p\alpha$ since $(x^p-x)^{\alpha}$ is monic of degree $p\alpha$ and satisfies our conditions.


As noted in my comments above, if $p(x)$ is always zero modulo $n$ then so is $p(x+1)-p(x).$

In the monic case, this means if $p(x)$ is minimal then $d=\deg p(x)$ must have a common factor with $n,$ since otherwise $q(x)=p(x+1)-p(x)$ is of smaller degree with leading coefficient $d$ so we solve $du-nv=1$ and take $r(x)=uq(x)-nvx^{d-1}$ which is monic of smaller degree and satisfies our condition.


To finish the question, one needs to compute a value of $D(p^{\alpha}),$ which we know is divisible by $p$ and $\leq p\alpha.$


Conjecture

My guess is that $D\left(p^{\alpha}\right)$ is the smallest $d$ such that $\nu_p(d!)\geq \alpha.$ In particular, if $\alpha\leq p$ then $d=\alpha p.$ If $\alpha=p+1$ then $\nu_p\left((p^2)!\right)=p+1.$ Do $D(p^p)=D(p^{p+1})=p^2.$

This is definitely an upper bound, because the falling factorial $(x)_d$ is monic and of degree $d$ and is always divisible by $p^{\nu_p(d)}.$


Which polynomials induce the zero function mod $n$?

As proved in another answer, the polynomials that induce the zero function mod $n$ are precisely those that, when written in the form $$f(x) = \sum_{k} c_k x^{\underline k},$$ satisfy the property that $c_k$ is divisible by $n\,/\gcd(n, k!)$, for each $k$. (Here, $x^{\underline k}$ is the "falling factorial": $x^{\underline k} = x(x-1)\cdots(x-k+1)$.)


That answers the first question, and to answer the other questions:

What is the polynomial of least degree that induces the zero function mod $n$?

I'm assuming you don't accept polynomials like $f(x) = 0$ or $f(x) = n$ or $f(x) = nx + 2n$, etc, i.e. you want the coefficients to be nonzero mod $n$. When $k$ is less than the smallest factor of $n$, we get $\gcd(n, k!) = 1$, which means that $c_k$ is a multiple of $n$. We can take $c_k$ nonzero mod $n$, when $\gcd(n, k!) > 1$, which happens when $k$ is the smallest prime factor of $n$, say $p$. Then we need $c_k$ to be a multiple of $n / \gcd(n, k!) = n / p$, so we can take $c_k$ to be $n/p$ and all other coefficients $0$, so that $f(x) = (n/p) x^{\underline p} = (n/p) x(x-1)\cdots(x-p+1)$. Other polynomials of degree $p$ may also be possible.

This gives the following table, as in the question:

$$ \begin{array}{rll} n & L_n\text{ from question} & L_n\text{ from this answer} \\ 2 & x^2+x & (2/2)x^{\underline 2} = x^2 - x \\ 3 & x^3-x & (3/3)x^{\underline 3} = x(x-1)(x-2) = x^3 - 3x^2 + 2x \\ 4 & 2(x^2+x) & (4/2)x^{\underline 2} = 2(x^2 - x) \\ 5 & x^5-x & (5/5)x^{\underline 5} = x^5 - 10x^4 + 35x^3 - 50x^2 + 24x \\ 6 & 3(x^2+x) & (6/2)x^{\underline 2} = 3(x^2 - x) \\ 7 & x^7-x & (7/7)x^{\underline 7} = … \\ 8 & 4(x^2+x) & (8/2)x^{\underline 2} = 4(x^2 - x) \\ 9 & 3(x^3-x) & (9/3)x^{\underline 3} = 3(x^3 - 3x^2 + 2x) \\ 10 & 5(x^2+x) & (10/2)x^{\underline 2} = 5(x^2-x) \\ 11 & x^{11}-x & (11/11)x^{\underline{11}} = … \\ 12 & 6(x^2+x) & (12/2)x^{\underline 2} = 6(x^2 - x) \\ 13 & x^{13}-x & (13/13)x^{\underline{13}} = … \\ 14 & 7(x^2+x) & (14/2)x^{\underline 2} = 7(x^2 - x) \\ 15 & 5(x^3-x) & (15/3)x^{\underline 3} = 5(x^3 - 3x^2 + 2x) \\ 21 & 7(x^3-x) & (21/3)x^{\underline 3} = 7(x^3 - 3x^2 + 2x) \\ 24 & 12(x^2+x) & (24/2)x^{\underline 2} = 12(x^2 - x) \end{array} $$

so you see it matches in each case (is congruent mod $n$). It's not too hard to prove that for prime $p$, $x^{\underline p}$ is the same as $x^p - x$ modulo $p$.


What is the monic polynomial of least degree that induces the zero function mod $n$?

For this we need $c_d = 1$ where $d$ is the degree of the polynomial, and this must be a multiple of $n / \gcd(n, d!)$, so $n / \gcd(n, d!)$ must be $1$, or in other words $\gcd(n, d!) = n$ which means that $n$ divides $d!$. This is called the Kempner function. So we can take $c_d = 1$ and all other $c_k$ to be $0$.

This gives the following table, for the examples in the question:

$$ \begin{array}{rll} n & M_n\text{ from question} & M_n\text{ from this answer} \\ 2 & x^2+x & x^{\underline 2} \\ 3 & x^3-x & x^{\underline 3} \\ 4 & x^4-x^2 & x^{\underline 4} = x^4 - 6 x^3 + 11 x^2 - 6 x \\ 5 & x^5-x & x^{\underline 5} \\ 6 & x^3-x & x^{\underline 3} = x^3 - 3 x^2 + 2 x \\ 7 & x^7-x & x^{\underline 7} \\ 8 & x^4+2x^3+3x^2+2x & x^{\underline 4} \\ 9 & x^8-x \quad (???) & x^{\underline 6} \\ 10 & x^5-x & x^{\underline 5} \\ 11 & x^{11}-x & x^{\underline{11}} \\ 12 & x^4+5x^2+6x & x^{\underline 4} \\ 13 & x^{13}-x & x^{\underline{13}} \\ 14 & ??? & x^{\underline 7} \\ 15 & x^5-x & x^{\underline 5} \\ 21 & ??? & x^{\underline 7} \\ 24 & x^4+2x^3+11x^2+10x & x^{\underline 4} \end{array} $$

which answers some of the $???$s in the question, corrects one of them ($M_9$ has degree $6$, not $8$), gives the same polynomials mod $n$ for some $n$, and some truly different (though they can be checked to work: so $M_n$ is not unique as a polynomial, though the polynomial function (mod $n$) itself is unique).


When is $x^{r+\lambda (n)}-x^r$ the monic polynomial of least degree that induces the zero function mod $n$?

As "the monic polynomial of least degree" is not unique (see the examples just above), the relevant question is to ask when the degree matches. For this to happen, $r + \lambda(n)$ must be the Kempner function of $n$ (let's call it $K(n)$), i.e. the smallest $k$ such that $n$ divides $k!$. This happens when either:

  • $n = 4$, or
  • $n = 12$, or
  • $n = p_1 p_2 \ldots p_m$ a product of distinct primes and $p_m - 1$ is divisible by $p - 1$ whenever $p$ is any of the primes $p_1 < p_2 < \ldots < p_m$. (This case includes the cases of $n$ being prime, $n$ being $2p$, or $3p$, or $2 \cdot 3 \cdot p$, or $5p$ where $p \equiv 1 \pmod 4$, or $11p$ where $p > 11$ and $p \equiv 1 \pmod{10}$, etc.)

The proof is as follows. First, for prime powers $n = p^r$, note that $\lambda(n) = p^{r-1}(p-1)$ while $K(n) \le rp$ (it's equal when $r \le p$, and smaller for larger $r$). So for them to be equal, we need $r + p^{r-1}(p-1) \le rp$ which happens only when $r=1$ or for $(p, r) = (2, 2)$. Next, when $n$ has prime factorization $n = p_1^{e_1} \cdots p_m^{e_m}$, the Carmichael function $\lambda(n) = \operatorname{lcm}(\lambda(p_1^{e_1}), \ldots, \lambda(p_m^{e_m}))$. Meanwhile, the RHS $K(n)$ is $\max(K(p_1^{e_1}), \ldots, K(p_m^{e_m}))$. Now if the maximum on the right is attained at a certain $J$, then the same inequality gives that either $e_J = 1$ and $r = 1$ so $n$ is a product of distinct primes and the property above needs to hold so that the LCM of the values $(p_j - 1)$ doesn't exceed $p_m - 1$, or else the special case of $J = 1$, $p_1 = 2$, $e_1 = 2$, and other primes if any are less than $2^2$ so $n$ is either $2^2 = 4$ or $2^2 \cdot 3 = 12$.


To answer the final two questions (and the comment before them):

It seems clear that $L_{2m}=m(x^2+x)$

Yes we can take $m(x^2 + x)$; note that our above method gives the polynomial $(2m/m)x^{\underline 2} = m(x^2 - x)$ which is the same mod $2m$.

Is $L_{pq} = qL_p$ and $M_{pq}=L_q$ for $p<q$ primes?

For $L_p$ we can take $(p/p)x^{\underline p}$ and for $L_{pq}$ we can take $(pq/p) x^{\underline p}$, so yes for the first part. Similarly, for the second part, we can take $L_q = x^{\underline q}$ and $M_{pq}$ to be $x^{\underline q}$ as well, as $pq$ divides $q!$ when $p < q$.

If $n=pm$ and $p$ is smallest prime divisor of $n$, then is $L_{pm}=mL_p$?

Yes, as above, for $L_p$ we take $x^{\underline p}$ and for $L_{pm}$ we take $(pm/p) x^{\underline p}$.


These papers characterize the polynomials that induce the zero function mod $n$:

  • On polynomial functions (mod $n$) by Singmaster (1974)

  • Polynomials and their residue systems by Kempner (1921)

Kempner's paper is closer to what I have in mind. I'll have to check it more closely.

I came across Kempner's paper in the paper A basis for residual polynomials in $n$ variables by Litzinger (1935).