01234567891011
Number theory · Concept hubDeep story

Modular Arithmetic

1801 CE19th-century Germany (Gauss)

Concept

The arithmetic of clocks — wrapping around at a modulus. The basic language of number theory and cryptography.

Understand it in one breath

Integers belong to the same class when they leave the same remainder modulo n. This appears naturally in clocks, calendars, checksums, and number theory; Gauss systematized congruence notation and theory in 1801. RSA and Diffie–Hellman use modular arithmetic centrally, while hashes, error correction, and internet security also require other algebra and protocols.

At a glance

×

0

1

2

3

4

5

6

0

0000000

1

0123456

2

0246135

3

0362514

4

0415263

5

0531642

6

0654321

Multiplication table mod 7 — every nonzero row contains exactly one 1, a consequence of 7 being prime.

Key formula

ab(modn)    n(ab)a \equiv b \pmod{n} \iff n \mid (a - b)

Worked examples

  1. 1

    Q.7 o’clock + 8 hours = ?

  2. 2

    Q.3 × 5 (mod 7)

Key moments

300 BCE

Euclid’s Elements — a precursor to congruence

Euclid already used the greatest-common-divisor algorithm. The tools of modular arithmetic existed long before its formal notation.

1801 CE

Gauss — Disquisitiones Arithmeticae

At age 24, Gauss introduced congruence notation (≡) and organized modular arithmetic into a general theory, transforming number theory.

1640 CE

Fermat’s little theorem

The congruence a^p ≡ a (mod p) for prime p became a core tool of public-key cryptography more than three centuries later.

1977 CE

RSA — modular arithmetic secures the network

Ron Rivest, Adi Shamir, and Leonard Adleman built public-key encryption from modular exponentiation and the difficulty of factoring a product of large primes.

Modern applications

RSA, Diffie–Hellman, and elliptic-curve cryptography; hash functions; checksums; and twelve-tone music theory.

Beyond MathVoyage

Loading…