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 ?

We are given the fact that $gcd(n,p-1)=1$ i.e.
$$nk_1=k_2(p-1)+1 \implies n=k_2\times k_1^{-1}(p-1)+1\tag{1}$$, for some integers $k_1$ and $k_2$
Let ,we are asked to find $x^n \mod p$ i.e.
$$x^{(k_2 k_1^{-1}p-k_2 k_1^{-1}+1)}\mod p\tag{2}$$ Since $p$ is a prime,
$x^p \mod p=x$
.Put it in expression (2) to get $x \mod p$, so the answer will be $x$.
 Hence proved if $x<p$
