Sub topic 1
Dividend, Divisor, Quotient and Remainder
This chapter sets up the vocabulary for every later remainder method in this tutorial. It covers the division algorithm, congruence notation, how remainders combine under addition, subtraction and multiplication, and negative remainders as a shortcut.
Prerequisites
You should be comfortable with integer division, basic divisibility, and positive integer exponents. You should also know what a factor is.
The division algorithm
For any integer dividend a and positive divisor b, there is exactly one quotient q and one remainder r such that:
a = b × q + r, with 0 ≤ r < b
The remainder is always smaller than the divisor and never negative when the divisor is positive.
For example, 47 = 6 × 7 + 5, so 47 leaves remainder 5 on division by 6.
Congruence notation
We write a ≡ b (mod n) to mean that a and b leave the same remainder when divided by n. Equivalently, n divides (a − b).
So 47 ≡ 5 (mod 6), because 47 − 5 = 42 is divisible by 6.
Adding, subtracting and multiplying remainders
Remainders combine predictably. To find the remainder of a sum, difference or product, you can reduce each part first and then combine:
- (a + b) mod n = ((a mod n) + (b mod n)) mod n
- (a − b) mod n = ((a mod n) − (b mod n)) mod n
- (a × b) mod n = ((a mod n) × (b mod n)) mod n
This keeps the numbers small, which matters under exam time pressure.
Negative remainders as a shortcut
When a number sits just below a multiple of n, it is often easier to write it as a negative remainder. For example, 99 ≡ −1 (mod 100) and 98 ≡ −2 (mod 100). So:
99 × 98 ≡ (−1) × (−2) = 2 (mod 100)
q, r = divmod(47, 6)
print(q, r) # 7 5
print(47 == 6 * q + r) # True
print((99 * 98) % 100) # 2
print((-7) % 5) # 3Exercise
Find the remainder when 123 × 127 is divided by 10 using the reduction rule.
Show answer
123 ≡ 3 and 127 ≡ 7 (mod 10), so the product ≡ 3 × 7 = 21 ≡ 1 (mod 10). The remainder is 1.