The Question
Given a fixed $n\in \mathbb{Z}^+$, what is the value of the sum
$$f(n) = \sum_{i=0}^{n-2}~n \!\!\!\!\pmod{n - i}?$$
My Work
So far, I have only been able to get a lower bound using triangular numbers. Let $a = \lfloor\frac{n}{2}\rfloor.$ Then we have the equality
$$\sum_{i=0}^{a} n \!\!\!\pmod{n-i} = \sum_{i=0}^{a} i = T_{a}$$
So $T_{a}$ is a very rough lower bound, as it is a truncation of half the sum.