# $r$ is a primitive root of odd prime $p$ and $a\not\equiv 0\pmod{p}$. Find the number of solutions to the congruence $xr^x\equiv a\pmod{p}$

$r$ is a primitive root of odd prime $p$ and $a\not\equiv 0\pmod{p}$. Find the number of solutions to the congruence $$xr^x\equiv a\pmod{p}$$

Here is my attempt :
Since $r$ is a primitive root, there exists $k$ such that $x\equiv r^k\pmod{p}$. Therefore the congruence becomes $$r^kr^{r^k}\equiv a \pmod{p}\\r^{r^k+k}\equiv a \pmod{p}$$

I don't know where to go from here. Any help? Thanks!

• Try writing $a$ as a power of $r$, and note that you can reduce the exponent mod $p-1$ (not mod $p$, so you can't put $r^k$ in the exponent). – Nishant Apr 2 '15 at 16:18
• Ahh that looks neat... do I get $r^k+k\equiv \text{ind}_r a \pmod{p-1}$ ? How to conclude about the number of solutions from here ? – rrr Apr 2 '15 at 16:20
• While the problem statement isn't clear (in fact, I'd call it actively misleading), yes, you should certainly look at $x$ modulo $p(p-1)$. – Greg Martin Apr 2 '15 at 16:32
• which part isn't clear/misleading @GregMartin ? this is related to discrete lambert problem if it helps.. – rrr Apr 2 '15 at 17:02
• What does $\text{ind}_r$ mean? – Nishant Apr 2 '15 at 18:45