.
The sum of floor((ai + b) / d) for all i = 0, …, n - 1. Assume that n >= 0 and d != 0.
n >= 0
d != 0
Math
.