12

The polynomial $x\mapsto x^3$ is not a permutation polynomial modulo 7, for example $1^3\equiv 2^3\pmod{7}$. However, for every integer $n$, at least one of three congruences $x^3\equiv n\pmod{7}$, $x^3+3\equiv n\pmod{7}$, $x^3+4\equiv n\pmod{7}$ is solvable: if $n\in\left\{0,1,6\right\}\pmod{7}$ then the first congruence is solvable; if $n\in\left\{2,3,4\right\}\pmod{7}$ then second congruence is solvable; if $n\equiv 5\pmod{7}$ then third congruence is solvable:

$$ \begin{array}{r|ccccccc} x & 0 & 1 & 2 & 3 & 4 & 5 & 6\\ \hline x^{3}\bmod{7} & 0 & 1 & 1 & 6 & 1 & 6 & 6\\ \left(x^{3}+3\right)\bmod{7} & 3 & 4 & 4 & 2 & 4 & 2 & 2\\ \left(x^{3}+4\right)\bmod{7} & 4 & 5 & 5 & 3 & 5 & 3 & 3 \end{array} $$

Definition ("good" integer): Call an integer $m\equiv 1\pmod 3$ "good" when there exist two integers $i$ and $j$ such that, for every integer $n$, at least one of three congruences $x^3\equiv n\pmod{m}$, $x^3+i\equiv n\pmod{m}$, $x^3+j\equiv n\pmod{m}$ is solvable.

  • Here is an attempt at a formal restatement of the definition ($m$ is a "good" integer). Here $m$, $i$, $j$, $n$, $x$ range over $\mathbb{Z}$; the notation $x\equiv_{m}y$ is a shorthand for $x\equiv y\pmod{m}$: $$ \left(m\equiv_{3}1\right)\land\left(\exists i.\exists j.\forall n.\exists x.\left(\left(x^3\equiv_{m}n\right)\lor\left(x^3+i\equiv_{m}n\right)\lor\left(x^3+j\equiv_{m}n\right)\right)\right) $$

The number $7$ is a "good" integer (choose $i=3$, $j=4$). I think $m=13$ is not a "good" integer, but I do not know a good way to prove this without trying possible choices of $i$, $j$.

Question: What are "good" prime numbers $m$?

I think $m=7$ is the only example below 100. A "near-miss" is $m=19$: if one chooses $i=2$ and $j=5$, then at least one of congruences $x^3\equiv n\pmod{19}$, $x^3+2\equiv n\pmod{19}$, $x^3+5\equiv n\pmod{19}$ is solvable for every $n\not\equiv 15\pmod{19}$; however, neither congruence is solvable for $n\equiv 15\pmod{19}$ (see the table of remainders below); and I think there is no way to choose $i$, $j$ to hit every remainder modulo 19 at least once. I do not know if there are any other "good" primes or near-misses.

$$ \begin{array}{r|ccccccccccccccccccc} x & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18\\ \hline x^{3}\bmod{19} & 0 & 1 & 8 & 8 & 7 & 11 & 7 & 1 & 18 & 7 & 12 & 1 & 18 & 12 & 8 & 12 & 11 & 11 & 18\\ \left(x^{3}+2\right)\bmod{19} & 2 & 3 & 10 & 10 & 9 & 13 & 9 & 3 & 1 & 9 & 14 & 3 & 1 & 14 & 10 & 14 & 13 & 13 & 1\\ \left(x^{3}+5\right)\bmod{19} & 5 & 6 & 13 & 13 & 12 & 16 & 12 & 6 & 4 & 12 & 17 & 6 & 4 & 17 & 13 & 17 & 16 & 16 & 4 \end{array} $$

mezzoctane
  • 2,241
  • 2
  • 8
  • 21
  • Comments have been moved to chat; please do not continue the discussion here. Before posting a comment below this one, please review the purposes of comments. Comments that do not request clarification or suggest improvements usually belong as an answer, on [meta], or in [chat]. Comments continuing discussion may be removed. – Shaun Dec 02 '25 at 11:43

1 Answers1

16

The goodness condition makes sense for any $m$ which is not divisible by $3$: this is the condition that we are enforcing throughout this answer.

Let $X$ be the set of square-free products of primes congruent to $2$ modulo $3$, for easier notation.

We show that good integers are exactly those of the form:

  1. $m$ for $m \in X$,
  2. $7m$, where $m \in X$,
  3. $q^r m$, where $q \equiv 2 \mod{3}$ is prime, $r \geq 2$, and $m \in X$ is coprime to $q$,
  4. $4q^a m$, where $q$ is an odd prime congruent to $2$ mod $3$, $a \geq 2$ and $m \in X$ is coprime to $2q$,
  5. $p^aq^b m$, where $p < q$ are odd primes congruent to $2$ mod $3$, $a,b \geq 2$, and $m \in X$ is coprime to $pq$.

Suppose that $p > 7$ is prime and good with the choice of $i,j$. Let $A$ be the set of cubes in $\mathbb{F}_p$, $B=A+i$, $C=A+j$. By inclusion-exclusion, $|A \cap B| + |A \cap C|\leq 2$, because the cardinalities of $A,B,C$ are all equal to $\frac{p+2}{3}$.

Assume that $A \cap B =\emptyset$.

Then the equation $x^3-y^3-iz^3$ has no solution with $z \neq 0$, so its number of solutions in $\mathbb{P}^2(\mathbb{F}_p)$ is $3$. But this equation defines an elliptic curve, so by Hasse’s theorem one has $(\sqrt{p}-1)^2 \leq 3$, a contradiction.

So $A \cap B$ is non-empty; similarly, $A$ meets $C$ and $B$ meets $C$. This implies by inclusion-exclusion that all intersections are reduced to the same point $t \in \mathbb{F}_p$.

If $i$ were a cube, then $0,i \in A \cap B$, so $i$ is not a cube. For the same reason, $j$ and $i-j$ are not cubes.

Now, since $A \cap B$ has a single element, the equation $x^3-y^3-iz^3$ has $3$ solutions in $\mathbb{P}^2(\mathbb{F}_p)$ where $z =0$, and $9$ where $z \neq 0$. Again by Hasse, this implies that $12 \geq (\sqrt{p}-1)^2$, which implies $p \in \{13,19\}$.

Now, note that if $x, y \in A$ and $x-y=i$, then $-y,-x \in A$, and $(-y)-(-x)=i$. Therefore one has $y=-x$ and $i$ is twice a cube. For the exact same reasons, so are $j$ and $j-i$. Rescaling, we may assume that $i=2, j=2k^3$, and $k^3, k^3-1$ are non-zero cubes.

For $p=13$, this is impossible. For $p=19$, this is possible with $k^3 \in \{8,-7\}$ ie $j \in \{-3,5\}$, and, if I did the math correctly, neither works out.

Upshot: the only good prime $p \equiv 1 \mod{3}$ is $p=7$. In particular, if $m$ is good, then its only prime divisors are congruent to $2$ mod $3$ or $7$.


Note that $49$ is not good. Indeed, assume that it is good with $i,j$. Then $i,j$ are not congruent modulo $7$ or divisible by $7$.

If $i,j$ are not cubes mod $7$, then none of $7, 7-i, 7-j$ is a cube mod $49$.

If $i$ is a cube mod $7$ (hence mod $49$), we may rescale and assume that $i=1$. This forces $j=4 \mod {7}$. Then $j+7$ is not $j$ plus a cube mod $49$, and is neither a cube nor $1$ plus a cube mod $7$.


The number $28$ is not good either: it only contains $9$ cubes.


Note that every element is a cube modulo a square-free product of primes congruent to $2$ mod $3$.

Therefore, good integers are of the form $\pi MN$, where $\pi$ is $1,7$ or $2^r \geq 4$, $M$ is an odd product of primes congruent to $2$ mod $3$, all of which appear with multiplicity at least $2$, and $N$ is a square-free product of primes congruent to $2$ mod $3$ that is coprime to $\pi M$, and whether $\pi MN$ is good only depends on $\pi M$.


If $M > 1$, $7M$ is never good.

Suppose for the sake of contradiction that it is good for $i,j$.

As we’ve seen in the $49$ case, there is always a class $k$ mod $7$ such that there is a unique $x \in \{0,i,j\}$ such that $k-x$ is a cube mod $7$.

Pick a prime $p \mid M$, and consider an integer $n$ congruent to $k$ mod $7$ and such that $n-x$ has $p$-adic valuation exactly one. Then $n-x$ is not a cube mod $7M$ and if $y \in \{0,i,j\} $ with $y \neq x$, $n-y$ is not a cube mod $7$ hence not mod $7M$.


If $M > 1$, then $8M$ is never good.

Suppose that it is good for $i,j$. Let’s assume that $i$ is even and $j$ is odd, the other cases are similar. There is an even class $k$ mod $8$ such that $k$ and $k-i$ are not cubes mod $8$.

Pick a prime $p$ dividing $M$, and let $n$ be congruent to $j+p$ mod $M$ and to $k$ mod $8$. This gives a counter-example, since $n \mod{8M}$ is not a cube, nor a cube plus $i$, nor a cube plus $j$.


If $M >1$ is not a prime power, then $4M$ is not good.

Indeed, suppose that it is good with $i,j$. Rename $\{0,i,j\}$ so that has two integers $x,y$ of same parity and one $z$ of the other parity.

Let $p,q$ be two distinct primes dividing $M$. Then take $n$ congruent to $z+2$ mod $4$, $x+p$ mod $p^2$ and $y+q$ mod $q^2$. This is a counter-example.


If $M > 1$ has three prime distinct divisors, it is never good. The argument is the same.


So we need to show that $2^r$ is always good and that, $p^aq^b$ (for $p < q$ primes congruent to $2$ mod $3$ and $p^a=4$ if $p=2$) are always good.

For $2^r$, either $x$ or $x-1$ is odd; this one will be a cube.

For $M=p^aq^b$ with $p$ odd, take $i,j$ such that the classes of $0,i,j$ mod $p$ are pairwise distinct, and same mod $q$: then, for any $n$, there is some $k \in \{0,i,j\}$ not congruent to $n$ mod $p$ or mod $q$: then $n-k$ is an invertible cube mod $p$ and mod $q$, hence a cube mod $M$.

For $M=4q^b$, take $i=2$ and $j$ odd not congruent to $0,2$ mod $q$. Note that any element of $\mathbb{Z}/M\mathbb{Z}$ which is not congruent to $2$ mod $4$ is a cube.

If $n$ is odd, then $n$ or $n-i$ is invertible mod $q$, hence mod $M$, hence is a cube.

If $n$ is divisible by $4$, either $n$ is invertible mod $q$ (hence a cube mod $M$) or $n-j$ is (it is odd, so it is also a cube mod $M$).

If $n$ is congruent to $2$ mod $4$, then either $n-2$ is invertible mod $q$ (hence a cube mod $M$, since it is divisible by $4$) or $n-j$ is invertible mod $q$ (hence a cube mod $4M$, since it is odd).

This concludes the proof.

Aphelli
  • 38,604
  • Shouldn't the inequality used for $p\in\left{13,19\right}$ be $12\le\left(\sqrt{p}+1\right)^2$ instead of $12\le\left(\sqrt{p}-1\right)^2$? I'll need some time to digest the answer; thanks for writing this up. – mezzoctane Dec 02 '25 at 13:40
  • 1
    Hasse certainly does not imply that $12 \leq (\sqrt{p}-1)^2$, indeed. It does imply that $12 \leq (\sqrt{p}+1)^2$, but that’s not useful for our purposes. The correct inequality (now fixed!), which is also implied by Hasse, was $12 \geq (\sqrt{p}-1)^2$. – Aphelli Dec 02 '25 at 13:43
  • Maybe one can avoid Hasse’s theorem by arguing as follows: let $p>7$ be a good prime for $i,j$ congruent to $1$ mod $3$ and let $A,B,C$ be as in the proof. Suppose we can show that any element of $\mathbb{F}_p$ is the difference of two cubes (this is where we use Hasse the first time; I don’t have another proof but this should be easier). Then any two among $A,B,C$ meet, so by inclusion-exclusion $A \cap B = B \cap C = A \cap C ={t}$ for some $t$. Now, $x \mapsto i-x$ is an involution of $A \cap B$, so $t=i-t$ ie $i=2t$. Similarly $j=2t$, a contradiction. – Aphelli Dec 02 '25 at 19:28