Solve the recurrence $$X_n =\begin{cases} n & 0 \leq n < m\\ X_{n-m} + 1 & n \geq m.\end{cases}$$
So I've started with several base cases, but since the answer depends on $n$'s relation to $m$, doesn't that mean my base cases have to propose both an $n$ value and an $m$ value?
I know the answer is $$\left\lfloor\frac{n}{m}\right\rfloor+(n\bmod m),$$ But I don't know how to get to the answer. I'm having a really hard time marrying the recurrence material to the floor/ceiling material to the modular arithmetic material.
Sorry about the formatting, but if anyone can help, I would really appreciate it!
Hint: Check, that your answer is equivalent to: $$n+\left\lfloor\frac{n}{m}\right\rfloor(1-m)$$
Then use induction: