Kolton Ndoj

Clock arithmetic

Wrap the number line around a clock of size n and many different numbers land on the same mark.

a≡b(modn)a\equiv b\pmod{n}

What the symbols mean

≡\equiv
has the same remainder as
nn
the size of the clock
a,ba,b
numbers that land on the same spot

Why it works — the picture

On a 12-hour clock, 15 o'clock is 3 o'clock. Mathematicians say 15 is congruent to 3 mod 12. The great discovery is that you can add and multiply on the clock face and always get a consistent answer, so you can work with remainders instead of enormous numbers. Cycles, weekdays and digit tricks like casting out nines all come from this.

Graph for Clock arithmetic 060210
The remainder of t after dividing by n: a sawtooth that climbs, then snaps back to 0. Change n and see the pattern repeat sooner or later. (drawn with the default slider values — move the sliders live)

Try it yourself

Where it’s used in real life

Internet security (RSA and elliptic-curve cryptography), ISBN and credit-card check digits, calendars and hash functions.

The story behind it

Gauss introduced the congruence notation in his 1801 book on number theory.

Related

Play with it live →

Math · Number theory · Intermediate