Remainders of sums and differences

Divide 13 by 8 and you get remainder 5. Divide 14 by 8 and you get remainder 6. Add 13 and 14 to get 27, then divide by 8 — remainder 3. Notice that 3 is not 5+6=115+6=11; it is 1111 with the divisor 88 stripped out once. That single observation is the whole idea of this section: remainders of a sum (or difference) behave exactly like the numbers do, as long as you are willing to add or subtract the divisor to keep the remainder inside its proper range. Once this rule is in hand, remainder puzzles that look like they need long division collapse into one or two lines of quick arithmetic — no calculator, no full division, just the division algorithm applied twice and combined.

The core insight

Add or subtract two known remainders directly, then push the result back into the range 00 to d−1d-1 by adding or subtracting the divisor dd as many times as needed.

The core idea

Start from the division algorithm. Every whole number nn divided by a divisor d>0d>0 can be written uniquely as

n=dq+r,0≤r<d,n = dq + r, \qquad 0 \le r < d,

where: qq is the quotient and rr is the remainder. This is the only tool this section uses — no new machinery, just the same idea applied to two numbers at once and then combined.

Adding two numbers with the same divisor. If a=dq1+r1a = dq_1+r_1 and b=dq2+r2b = dq_2+r_2 (same dd), then

a+b=d(q1+q2)+(r1+r2).a+b = d(q_1+q_2) + (r_1+r_2).

where: r1,r2r_1, r_2 are the individual remainders, each already satisfying 0≤r1,r2<d0 \le r_1,r_2 < d. The catch is that r1+r2r_1+r_2 can itself be dd or larger — up to 2d−22d-2 in the worst case — so it is not automatically a valid remainder. Whenever r1+r2≥dr_1+r_2 \ge d, subtract dd once (and add 11 to the quotient part) to land back in range; since r1+r2<2dr_1+r_2<2d, one subtraction is always enough.

Subtracting two numbers with the same divisor. Similarly a−b=d(q1−q2)+(r1−r2)a-b = d(q_1-q_2)+(r_1-r_2), and if r1−r2r_1-r_2 turns out negative, add dd once (and subtract 11 from the quotient part) to bring it back into 00 to d−1d-1. This shortcut is exactly why the rule is worth learning: for two large numbers, working out their individual remainders once and then just adding or subtracting those two small numbers is far quicker than dividing the full sum or difference from scratch, and it is the standard move behind almost every "find the remainder" puzzle you will meet in this chapter. The figure below shows why this works: picture the remainders 00 through d−1d-1 arranged around a circle of size dd. Adding remainders is just walking further around the circle — if you walk past the starting point, you have gone one full lap too many, so subtract dd (one full lap) to read off the true position.

Figure
A circle of eight positions numbered zero to seven showing remainder five stepping six more places and landing on three after passing the zero mark
Remainders mod 8 — 5 plus 6 wraps once to land on 3 0 1 2 3 4 5 6 7 start: r=5 end: r=3 6 steps from 5 pass 0 once, so subtract 8: 5+6-8=3

The adjustment rule for addition

The goal here is to prove carefully, from the division algorithm alone, that whenever two numbers share a divisor dd, the remainder of their sum is r1+r2r_1+r_2 if that sum is already less than dd, and otherwise it is r1+r2−dr_1+r_2-d, with the quotient increased by exactly one to compensate — never any other adjustment, however large r1r_1 and r2r_2 individually are.

Step 1. Write both numbers in division-algorithm form: a=dq1+r1a=dq_1+r_1 with 0≤r1<d0\le r_1<d, and b=dq2+r2b=dq_2+r_2 with 0≤r2<d0\le r_2<d. Adding gives a+b=d(q1+q2)+(r1+r2)a+b = d(q_1+q_2)+(r_1+r_2), which is a true equation, but the term (r1+r2)(r_1+r_2) is not guaranteed to be a valid remainder yet — it only counts as the remainder of a+ba+b divided by dd once it satisfies 0≤(r1+r2)<d0\le (r_1+r_2)<d.

Step 2. Bound the size of r1+r2r_1+r_2. Since 0≤r1<d0\le r_1<d and 0≤r2<d0\le r_2<d, adding the inequalities gives 0≤r1+r2<2d0 \le r_1+r_2 < 2d. So the sum of two remainders is never negative and never reaches 2d2d — it lands somewhere in the single interval [0,2d)[0, 2d).

Step 3. Split on that interval. If r1+r2<dr_1+r_2<d, the expression a+b=d(q1+q2)+(r1+r2)a+b=d(q_1+q_2)+(r_1+r_2) is already in proper division-algorithm form, so the remainder is simply r1+r2r_1+r_2. If instead d≤r1+r2<2dd \le r_1+r_2 < 2d, subtract dd from the remainder term and add 11 to the quotient term: a+b=d(q1+q2+1)+(r1+r2−d)a+b = d(q_1+q_2+1) + (r_1+r_2-d). Because r1+r2<2dr_1+r_2 < 2d, the new remainder r1+r2−dr_1+r_2-d satisfies 0≤r1+r2−d<d0 \le r_1+r_2-d < d, so this is now valid.

Step 4. Conclude. Exactly one of the two cases in Step 3 applies (the bound in Step 2 rules out needing a second subtraction), so the remainder of a+ba+b divided by dd is always either r1+r2r_1+r_2 or r1+r2−dr_1+r_2-d, decided purely by whether r1+r2≥dr_1+r_2\ge d. The same argument with a sign flip handles subtraction: if r1−r2r_1-r_2 is negative, adding dd once always suffices to bring it into [0,d)[0,d), because r1−r2>−dr_1-r_2 > -d whenever 0≤r1,r2<d0\le r_1,r_2<d.

Worked example

A number aa leaves remainder 5 on division by 8, and a number bb leaves remainder 6 on division by 8. What remainder does a+ba+b leave on division by 8, and what about a−ba-b?

Step 1. Write a=8q1+5a=8q_1+5 and b=8q2+6b=8q_2+6, so a+b=8(q1+q2)+(5+6)=8(q1+q2)+11a+b = 8(q_1+q_2)+(5+6) = 8(q_1+q_2)+11.

Step 2. Since 11≥811\ge 8, this is not yet valid; rewrite 11=8(1)+311=8(1)+3, giving a+b=8(q1+q2+1)+3a+b = 8(q_1+q_2+1)+3. So a+ba+b leaves remainder 3.

Step 3. Check with real numbers: a=13a=13 (since 13=8×1+513=8\times1+5), b=14b=14 (since 14=8×1+614=8\times1+6). Then a+b=27=8×3+3a+b=27=8\times3+3 — remainder 3, matching. Answer: remainder 3.

Step 4. Now for the difference: a−b=8(q1−q2)+(5−6)=8(q1−q2)−1a-b = 8(q_1-q_2)+(5-6) = 8(q_1-q_2)-1. Since −1-1 is negative, add 88: −1+8=7-1+8=7, and subtract 11 from the quotient part, giving a−b=8(q1−q2−1)+7a-b=8(q_1-q_2-1)+7. So a−ba-b leaves remainder 7. Check: 13−14=−113-14=-1; picking values where a>ba>b instead, say a=21a=21 (8×2+58\times2+5) and b=6b=6 (8×0+68\times0+6), gives a−b=15=8×1+7a-b=15=8\times1+7 — remainder 7, matching. Answer: remainder 7.

Competitive stretch

Three numbers x,y,zx,y,z leave remainders 4, 7, 3 on division by 9. Find the remainder of x+y−zx+y-z on division by 9. Combine all three remainders at once: 4+7−3=84+7-3=8, and since 0≤8<90\le 8<9 no adjustment is needed, so the remainder is 8 directly. Check: x=13,y=16,z=12x=13,y=16,z=12 give x+y−z=17=9×1+8x+y-z=17=9\times1+8. ✓

Common traps

  • Forgetting to subtract dd when r1+r2r_1+r_2 equals or exceeds dd — an unadjusted sum like 1111 is not a valid remainder for divisor 88.
  • Forgetting to add dd when r1−r2r_1-r_2 comes out negative, and leaving a negative "remainder" in the final answer.
  • Applying the rule across different divisors — the add/subtract-remainders shortcut only works when both numbers share the same dd.
  • Assuming a second adjustment is ever needed for addition of two single remainders — since each remainder is already less than dd, their sum is always below 2d2d, so at most one subtraction of dd is ever required.
  • Writing down an "answer" without checking it lies in 00 to d−1d-1 — a remainder of −2-2 or a remainder of 1010 for divisor 88 is always a sign that an adjustment step was skipped.

Ask the tutor: Want to try a remainder puzzle with three or four numbers combined, or check what happens when the divisors are different for each number?

Why do we even need to adjust by d — why not just add the remainders and call that the answer?

Because a remainder must always satisfy 0≤r<d0 \le r < d by definition — it is what is left over after dividing out as many whole copies of dd as possible. If you add two valid remainders, the sum can be as large as 2d−22d-2, which is not a valid remainder for divisor dd (it is at least one whole copy of dd too big). Subtracting dd once removes exactly that extra copy and restores a legitimate remainder in range.

Does the same adjust-by-d idea work for multiplying two remainders together?

The core idea generalises — you can multiply the individual remainders and then reduce the product back into 00 to d−1d-1 — but the adjustment is no longer a single subtraction of dd. Since r1r2r_1 r_2 can be much larger than dd (up to nearly d2d^2), you may need to subtract dd several times, or equivalently divide the product by dd and keep only its own remainder. This section covers only addition and subtraction, where one adjustment always suffices.

How is this different from the modular arithmetic notation I have seen online, like a is congruent to b mod n?

That congruence notation is the same underlying idea written in a compact symbolic shorthand used from higher classes onward. At this stage, everything should be expressed using the division-algorithm form n=dq+rn=dq+r with 0≤r<d0\le r<d, spelling out the quotient and remainder explicitly rather than using the congruence symbol. The reasoning is identical either way — this section simply keeps it in the form your syllabus expects.

Before this

Where this leads