learn › Number Theory

Clock arithmetic

lesson · about 3 minutes

Remainders, days of the week, and repeating cycles.

Pen and paper is fine · no calculator needed why?

Opens at level 31. You're level 1. You can read and practice here now.

the idea

Clock arithmetic keeps only remainders. Five hours after 9 o'clock is 2 o'clock, because 14 hours leaves 2 once you take out 12. We write 14 mod 12 for that remainder.

The key fact: you can take remainders first, then add, subtract or multiply, then take the remainder again. The answer is the same, and the numbers stay small.

techniques

Reduce first

Adding, subtracting or multiplying big numbers, then taking a remainder.

  1. Replace each number with its remainder.
  2. Do the arithmetic on the small remainders.
  3. Take the remainder again. If it came out negative, add the divisor.
worked example

Example: What is (86 × 53) mod 7? Give the remainder from 0 to 6.

  1. 86 leaves 2, and 53 leaves 4, when divided by 7.
  2. 2 × 4 = 8, and 8 leaves 1.

Answer: 1

Skip the whole weeks

The day of the week some number of days from today.

  1. Divide the number of days by 7 and keep the remainder.
  2. Whole weeks land on the same weekday, so ignore them.
  3. Count the remainder forward from today. Today itself is day 0, not day 1.
worked example

Example: Number the days of the week Sunday 0 to Saturday 6. Today is Wednesday, day 3. Which day number is 100 days from now?

  1. 100 = 14 × 7 + 2.
  2. Skip 14 weeks, then count 2 days on from Wednesday.
  3. That is Friday, day 5.

Answer: 5

Find the cycle

A big power, like 2¹⁰⁰, divided by a small number.

  1. List the remainders of the first few powers until they repeat: that is the cycle.
  2. Divide the exponent by the cycle length and keep the remainder.
  3. That remainder picks the entry in the cycle. A remainder of 0 means the last entry.
worked example

Example: What is 2²⁰ mod 7? Give the remainder from 0 to 6.

  1. Powers of 2 leave 2, 4, 1, then repeat: a cycle of 3.
  2. 20 = 6 × 3 + 2, so take the 2nd entry.
  3. The answer is 4.

Answer: 4

watch out for

practice

Sign in to try one

Remainder arithmetic

worked example

What is (650 + 763) mod 4? Give the remainder from 0 to 3.

Answer: 1

  1. Reduce first: 650 leaves 2 and 763 leaves 3 when divided by 4.
  2. 2 + 3 = 5, and 5 = 1 × 4 + 1, so the answer is 1.

Day of the week

worked example

Today is Saturday. What day of the week will it be 371 days from now?

  1. Saturday
  2. Thursday
  3. Friday
  4. Wednesday

Answer: Saturday

  1. 371 = 53 × 7 + 0.
  2. Whole weeks bring you back to Saturday, and there are no days left over: Saturday.

Powers in cycles

worked example

What is 8⁸⁷ mod 13? Give the remainder from 0 to 12.

Answer: 5

  1. Powers of 8 leave these remainders when divided by 13: 8, 12, 5, 1, then the cycle repeats every 4 steps.
  2. 87 = 21 × 4 + 3, so 8⁸⁷ leaves the same remainder as 8³: 5.

Sign in to start