Simple Introduction To Modular Arithmetic

Modular arithmetic, explained the way I would have liked to have learned it.
→ [preprint-e, preprint-p] ←1  Keywords: #integer-division #divisibility #modular-arithmetic #euclidean-algorithm

We define modular equivalence on the integers, and explain how to endow the set of equivalence classes modulo \(n\) with addition and multiplication. This is then used to provide a deeper understanding of the properties of congruences, and modular inverses (required for solving linear congruences).

The latter task (modular inversion) requires writing the greatest common divisor of two integers as a linear combination of said integers, leading us to explain—and implement in Python—the extended Euclidean algorithm. The code provided at the end of the manuscript is simplified to ease the explanation—a more complete version can be accessed here.

October 23, 2025. Got feedback? See the contact page.