For any integer a and positive integer n, there are unique integers q and r such that 0 r < n and a = qn + r

- q (= a/n) is the quotient of the division
- r (= a mod n) is the remainder
- a = a/nn + (a mod n) or

a mod n = a - a/nn - If (a mod n) = (b mod n), then a b (mod n)

Example

22 mod 5 = 2

-13 mod 5 = 2

-13 mod 5 = 2