How to convert an infinite summation to an integral [closed]

I need help converting this summation to an integral

$$\sum_{i=1}^\infty 1+\frac{\vert(n-im)\vert}{(n-im)}$$

I keep trying but get stuck so any help is appreciated.

closed as off-topic by Saad, John Omielan, trancelocation, RRL, Eevee TrainerApr 17 at 0:31

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – Saad, John Omielan, trancelocation, RRL, Eevee Trainer
If this question can be reworded to fit the rules in the help center, please edit the question.

The fraction is $$+1$$ or $$-1$$ depending on whether $$i \lt \frac nm$$ or $$i \gt \frac nm$$. If $$m$$ divides $$n$$ you have a term the divides by $$0$$ so the sum is undefined. Assuming you don't fall into the undefined trap, the summand is just $$2$$ as long as $$i \lt \frac nm$$, and $$0$$ after, so the sum is just $$2\lfloor \frac nm \rfloor$$. To convert it to an integral the function is just $$2$$ from $$0$$ to $$\lfloor \frac nm \rfloor$$ and $$0$$ after.