Divisibility and modular arithmetic
Euclid's algorithm finds gcd(a,b) by repeated division, and running it backwards writes the gcd as ax+by (Bézout). In modular arithmetic we work with remainders: a≡b(modn) means n∣a−b. Fermat: for prime p∤a, ap−1≡1(modp).
≈ 45 min