$(a^n+ b^n) \pmod p = c^n \pmod p$ relation between $n$ and $p$

75 Views Asked by At

I am aware of the fact that the equation $$(a^n+ b^n) \pmod p= c^n\pmod p$$ has a solution for every integer $n$ if $p$ (a prime) is large enough. But I am interested to know the relation between $n$ and $p$ to obtain a solution for the equation. In other words , say we have a prime $p$ then how to determine what values of $n$ can give a solution for $0<a,b,c<p$ .

Also, if we have a given integer $n$ , is there a way to determine what should be the minimum value of $p$ to obtain a solution of the equation? ($0<a,b,c<p$)

1

There are 1 best solutions below

1
On BEST ANSWER

Tests for small $n$ are easy: No solution for $n=0$, $(1,1,2)$ is a solution for $n=1$ (if $p>2$), $(3,4,5)$ is a solution if $p>5$.

For the general approach: By little Fermat, a solution for $n$ is a solution for $n'$ if $n'\equiv n\pmod{p-1}$, hence you need only check $0\le n<p-1$. In fact, by taking multiplicative inverses $\bmod p$, you need only check $n\le \frac{p-1}2$. As $n=\frac{p-1}2$ leads to $a^n\equiv \pm1\pmod p$, we can exclude $\frac{p-1}2$ for $p>3$. If $\gcd(d,p-1)=1$, taking $d$th powers is just a permutation of the non-zero residue classes $b\mod p$, i.e., a solution for $n$ exists iff a solution for $dn$ exists.

For exhaustive searches, one can follow achille hui's comment and look for $x^n+y^n\equiv 1\pmod p$, or equivalently for $x^n+1\equiv z^n\pmod p$. For a systematic approach, find a primitive root $\epsilon$ and for $1\le x\le p-1$ compute the discrete logarithm $L(x)$, i.e., $0\le L(x)<p-1$ with $\epsilon^{L(x)}\equiv x\pmod p$. Then $x$ is an $n$th power iff $dn\equiv L(x)\pmod {p-1}$ for some $d$. Hence by iterating iterate over the values and note that $x,x+1$ are a solution for $n$ iff $n$ is a common divisor of $L(x)+u(p-1)$ and $L(x+1)+v(p-1)$ for suitable $u,v$.