2

The question is about the equation $$ x^y\equiv y^x \mod n$$ where $x,y\in \mathbb N_{\geq 2}$.

How can you find if the equation admit a solution in $\mathbb{Z}/n\mathbb{Z}$ for a given $n$?

egreg
  • 238,574
E. Joseph
  • 14,843
  • You can certainly check all pairs $(n,m)$, since there is only finitely many of them... – M Turgeon Nov 08 '15 at 15:56
  • 1
    But other than that, I think this has already been answered here: http://math.stackexchange.com/questions/9505/xy-yx-for-integers-x-and-y – M Turgeon Nov 08 '15 at 15:58
  • 2
    I am not sure what the equation even means, since if $x\equiv a\pmod{n}$ and $u\equiv b$, we do not necessarily have $ x^y\equiv a^b\pmod{n}$. – André Nicolas Nov 08 '15 at 16:04
  • @MTurgeon The link you gave me doesn't answer it, because i'm looking at it in Z/nZ and that's what make it difficult for me. The first answer you gave is obviously right, but it isn't what i'm looking for. I'm more interesting in a method to find if the equation admit a solution for a given n. – E. Joseph Nov 08 '15 at 16:08
  • @AndréNicolas The equation means that $x$ and $y$ are both elements of $Z/nZ$, and the equation is looked from $Z/nZ$. – E. Joseph Nov 08 '15 at 16:09
  • 4
    What does $x^y$ mean in this context? Note that $2^3\equiv 2\pmod{3}$, while $2^6\not\equiv 2\pmod{3}$. But $3$ and $6$ are "the same" modulo $3$. – André Nicolas Nov 08 '15 at 16:15
  • To elaborate a bit on what @AndréNicolas is saying, elements of $\mathbb{Z}/n\mathbb{Z}$ are not integers, they are equivalence classes of integers. $2$ is not an element of $\mathbb{Z}/3\mathbb{Z}$; instead it is $[2]={2,5,8,11,\ldots}$. – vadim123 Nov 08 '15 at 16:21
  • @AndréNicolas Thanks to your comments, i edited the post. I hope what i meant is clearer now. Please let me know otherwise. – E. Joseph Nov 08 '15 at 16:25
  • @ElioJOSEPH Since you already know from MTurgeon's link that $x^y = y^x$ admits a solution, you don't need any method to find if $x^y \equiv y^x \pmod n$ admits a solution for a given $n$, because the answer to that is always "yes". If you care about more than just "yes", make your question more specific. – Erick Wong Nov 08 '15 at 16:37
  • An interesting example let $x = k_1\phi(n)$ , $y = k_2\phi(n)$ , where $\phi(n)$ is Euler's totient function then $x^y = x^{k_2\phi(n)} \equiv 1\ mod\ n$ and $y^x = y^{k_1\phi(n)} \equiv 1\ mod\ n$. In cases where $\phi(n) \lt\lt n$. –  Nov 08 '15 at 17:58
  • Here are all results for $2\le x<y\le8,$ and $n\le\max(x^y,y^x)+1.$ The case $x^y=y^x=16$ is omitted, for obvious reasons. – Lucian Nov 08 '15 at 19:44

0 Answers0