### liveoverflow's blog

By liveoverflow, history, 2 months ago, ,

Given $X,p,a,b$, we need to find out how many $n\in\mathbb N,\;(1\leqslant n\leqslant X)\;$ satisfy the following condition:

>

$na^n\equiv b\pmod{p}$

Constraints:

\begin{aligned}$$2\leqslant p\leqslant 10^6\\1\leqslant a,b\lt p\\1\leqslant X\leqslant 10^{12}$$\end{aligned}

I have no idea how to solve this question, any approach or proof will be highly appreciated.

 » 2 months ago, # |   0 Only $X$ is given? What about $a$ and $b$ and $p$? They can be anything?