2

Let $n$ be a positive integer. Determine whether, for every $x\in\left\{1,2,...,n-1\right\}$, there exist integers $a$ and $k$ such that:

$x = a^3+a$ (mod $n$)

If $n$ is coprime to $3$, prove or disprove that it is impossible for this to hold for all $x$ in $\left\{1,2,...,n-1\right\}$

Or in other words

Every positive integer below $n$ should be expressible in the following form: $a^3+a-nk$ where $a$ and $k$ are integers. Is this possible for numbers that are coprime to $3$?

What I need to prove that this is only possible when the specific number is divisible by 3.

Context:

This question is inspired by Problem 3 from the Asian Pacific Mathematical Olympiad 2014. I attempted to explore a particular approach to solving it and have reached this point. Admittedly, I haven’t made much progress along this path—it’s merely an idea I had, and I’m not even sure if it will work. I should warn you that this approach might lead to a disappointing conclusion, as the entire path I’ve chosen could ultimately amount to nothing. So far, I haven’t made any significant breakthroughs. I tried applying Fermat's Little Theorem, but it didn’t yield any useful insights.

Thank you so much for your time.

Jyrki Lahtonen
  • 140,891
  • The smallest examples all fail. Take $n=2$ so that $x=1$. Or take $n=4$ and $x=1,3$. Or take $n=5$ and $x=1,4$. Or take $n=6$ and $x=1,3,5$. – Servaes Dec 23 '24 at 11:10
  • It seems that $a^3+a$ covers all residues mod $n$ iff $n$ is a power of $3$. – lhf Dec 23 '24 at 11:34
  • @lhf Exactly! This is the answer I am trying to get. If we just proved it does not work for coprimes of 3, it is obvious it does not work for a multiple of something that does not work. Thus only powers of 3 works. Do you have a solution? – Ruchin Himasha Dec 23 '24 at 12:22
  • 1
    See https://en.wikipedia.org/wiki/Permutation_polynomial – lhf Dec 23 '24 at 14:15

2 Answers2

3

The answer is no when, for example, $n$ is a prime congruent to $1$ (mod $4$). In these cases, there exists $y$ such that $y^2\equiv-1\pmod n$. Then $0^3+0$ and $y^3+y$ and $(-y)^3+(-y)$ are all congruent to $0$ (mod $n$); and there's no way for the other $n-3$ inputs to hit all the remaining $n-1$ residue classes.

(By the way, one should definitely check small values of $n$ by hand; $n=5$ is small enough to discover that the answer is no.)

Greg Martin
  • 92,241
  • I apologize, but I’m not sure I understand your point. Are you saying that some numbers coprime to $3$ satisfy the equation, or that it’s impossible (which is what I need to prove.)? I checked $n=5$ by hand but couldn’t express 1 in the form $a^3+a−5k=1$ . Since this isn’t possible, the statement doesn’t hold for $5$, which helps support my argument. However, I’m struggling to generalize this, because even what I tried to prove holds for one specific case I can't come to conclusions. And that’s where I need your help. Thank you so much for the inputs. – Ruchin Himasha Dec 23 '24 at 08:10
3

Let $P(n)$ be the statement that $x^3+x\equiv a\pmod n$ is solvable for all $a\in\{0,1,2,\ldots,n-1\}$ (the case $a=0$ is uninteresting, but I include it anyway).

Clearly $P(n)$ is false whenever $n$ is an even number because $a^3+a$ as well as its remainder will then be even for all $a$.

Let $p>3$ be a prime number. My next goal is to prove that $P(p)$ fails. Consider the set $S$ of residue classes of $-4-3a^2$ modulo $p$, with $a$ again ranging over $\{0,1,\ldots,p-1\}$. We see that the congruence (all modulo $p$ for now) $$-4-3a^2\equiv-4-3b^2$$ holds if and only if $a^2\equiv b^2$. This happens if and only if either $a\equiv b$ or $a\equiv-b$. It follows that the set $S$ contains exactly $(p+1)/2$ residue classes: the choice $a=0$ yields $-4\in S$, and the rest of the choices for $a$ pair up in the sense that $a$ and $-a\equiv p-a$ yield the same element to $S$.

The exact same argument shows that the set $Q$ of residue classes of squares modulo $p$ also has exactly $(p+1)/2$ elements.

As there are exactly $p$ residue classes altogether, it follows that the sets $S$ and $Q$ necessarily intersect. In other words, there exists a pair of integers $a,b\in\{0,1,\ldots,p-1\}$ such that $$-4-3a^2\equiv b^2.$$

Time to get to the actual problem! Let $a$ and $b$ be some pair of integers satisfying the above congruence. We have the factorization (this holds for all $a$) $$ x^3+x-(a^3+a)=(x-a)\left(x^2+ax+[a^2+1]\right). $$ Look at that quadratic. Its discriminant $$ D=a^2-4[a^2+1]=-4-3a^2\equiv b^2 $$ is a square, so we know that it factors modulo $p$! More precisely, from the quadratic formula it follows that $$ x^3+x-(a^3+a)\equiv(x-a)(x+\frac{a+b}2)(x+\frac{a-b}2), $$ where division by $2$ is carried out "modulo $p$". This means that the remainders of $x^3+x$ at the choices $x=a$, $x=(-a+b)/2$, $x=(-a-b)/2$, the three roots of that cubic, are all equal. In other words, the same remainder occurs at least twice. Therefore $P(p)$ is false.

Of course, when $P(p)$ is false, it follows that $P(m)$ is false whenever $m$ is a multiple of $p$. The conclusion is thus that $P(n)$ can only be true, when $p=3$ is the only prime factor of $n$.


Adding a proof for the fact that $P(3^k)$ holds for all $k\ge1$.

Let $a,b$ be any integers. Let $f(x)=x^3+x$. As above, we have the factorization $$f(a)-f(b)=(a-b)(a^2+ab+b^2+1).\qquad(*)$$ It is easy to show that $a^2+ab+b^2+1$ is never divisible by three. We can either test all the nine cases, or observe that $$a^2+ab+b^2+1=(a-b)^2+1+3ab\equiv (a-b)^2+1.$$ As $2\equiv-1$ is not a quadratic residue modulo $3$, the claim follows.

The rest is easy. Fix a natural number $k\ge1$. As $3\nmid a^2+ab+b^2+1$, it follows that $3^k\mid [f(a)-f(b)]$ if and only if $3^k\mid a-b$. That's exactly the condition we need to show that $f$ permutes the residue classes modulo $3^k$ as prescribed.

Jyrki Lahtonen
  • 140,891