This is an interesting question i came across but am unable to find a solution to it.
Given $N$, $k$, we need to find $M$ such that $M+\left\lfloor \dfrac{M}{k} \right\rfloor+ \left\lfloor \dfrac{M}{k^2} \right\rfloor + \ldots + \left\lfloor \dfrac{M}{k^p} \right\rfloor=N$ where $\left\lfloor \dfrac{M}{k^p} \right\rfloor=0$. One thing that can be done is use brute force by taking different values of M. Is there any method by which we can generalize it or a better solution?