solutions to $x^n\equiv a\pmod{p}$ I'm asked to prove that if $\gcd(n,p-1)=1$ where p is prime, then
$$x^n\equiv a \pmod{p}$$
has exactly one solution. What I've done so far is the following,
Since $\gcd(n,p-1)=1$, that means, except for $1$, there is no least residue $r$ such that $r^n\equiv 1\pmod{p}$. Moreover, it would suffice to show that every least residue raised to $n$ is cogruent to another unique least residue
or, in other words, for any two least residues $a,b$,
$$a^n\equiv b^n\pmod{p}\quad\to\quad a\equiv b\pmod{p}.$$
To do so, suppose $a^n\equiv b^n\pmod{p}$, then
$$p\mid (a-b)(a^{n-1}+a^{n-2}b+\dots + b^{n-2}a+ b^{n-1})$$
and so $p$ must divide one of those terms. At this point, I tried to show that $p\nmid (a^{n-1}+a^{n-2}b+\dots + b^{n-2}a+ b^{n-1})$
by finding a contradiction but I got stuck. I'm thinking maybe one of my earlier steps was incorrect because I'm not really using the fact that $\gcd(n,p-1)=1$ in the proof. Am I heading in the right direction here ?

I found a proof that, more generally, if $p\not\mid a$, then $x^n\equiv a \pmod p$ has $0$ or $d=\gcd(n,p-1)$ solutions, depending on whether $a^{\frac{p-1}d}\equiv 1\pmod p$.   The proof uses a primitive root mod $p$...
I will try to reproduce it:  write $g^b\equiv a\pmod p$.  For any $x$ satisfying the congruence, we have $x$ is $g^m$ for some $m$..  Then $g^{nm}\equiv g^b\pmod p$, which means $nm\equiv b\pmod{p-1}$, since the order of $g\pmod p$ is $p-1$. This linear congruence has $0$ or $d$ solutions,  depending on whether $d\not\mid b$ or $d\mid b$.  Finally,  the latter condition is equivalent to $(p-1)\mid \frac{(p-1)b}d$, which is equivalent to $g^{\frac {(p-1)b}d}\equiv a^{\frac {(p-1)}d}\equiv 1 \pmod p$...
