In $a^n \equiv b^n \pmod m$, does $n$ have to be an integer? 
In $a^n \equiv b^n \pmod m$, does $n$ have to be an integer?

I just came upon this rule and am wondering its limits. Thank you
 A: As long as $a^n$ and $b^n$ are integers, there is nothing new.
I don't think that anything forbids to extend the definition of the modulo to non-integer numbers and say
$$a\equiv b\mod m\iff \frac{a-b}m\in\mathbb Z.$$
Then, 
$$2^{1/3}\equiv(15\sqrt[3]4+75\sqrt[3]2+127)^{1/3}\mod 5,$$
$$2^\pi\equiv \left((2^\pi+3e)^{1/\pi}\right)^\pi\mod e.$$
A: Usually in equations of the form $a^n \equiv_m b^n$, the $n$ is an integer. In general it is not well defined if $n$ is not an integer. If for example you take $n=\frac{1}{2}$ then for all odd prime $m$, an element $a$ will either have 2 roots, so that $a^{1/2}$ is two elements, or that $a$ has no roots at all. 
For example, for $m=3$ you get that $1^{1/2}\equiv_3 1,2$ while there is no root for $2$ and $0^{1/2}\equiv_3 0$. This is why this is not a standard notation.
EDIT: I assumed here that you meant that $m,a,b$ are integers, though of course this mustn't be the case.
A: What’s necessary is that exponentiation, $a^n$, must be well-defined for the values of $a$ and $n$, each in a specified domain; and the relation $a\equiv_m b$ must be well-defined within the range of values of the exponentiation. Here’s a relatively obscure example:
If $a$ is a principal unit in a $p$-adic domain such as $\Bbb Z_p$, that is $a\equiv_{\,p}\!1$, then if $z$ is any $p$-adic integer (in $\Bbb Z_p$, but need not  be rational), $a^z$ is well-defined, using completeness of $\Bbb Z_p$. So it’s perfectly grammatical to write $a^z\equiv_{p^m}b^z$.
