An Elegant Problem About Modular Arithmetic
Solving the problem "It's a Mod, Mod, Mod, Mod World" from Kattis.
By Thiago Felipe Bastos da Silva
There is a great problem on Kattis called It’s a Mod, Mod, Mod, Mod World with a short statement: given $p$, $q$, and $n$, find $\sum_{i = 1}^{n} \left[ (pi) \bmod q \right]$.
[Read More]