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:
>
Constraints:
I have no idea how to solve this question, any approach or proof will be highly appreciated.
Thank you in advance!