The following is a formal definition using equivalence relations:

Definition (integers modulo , )

The set of integers modulo is the set of all equivalence classes of integers under the equivalence relation if divides . We denote this set by . The set is a ring under the operations of addition and multiplication modulo .

For our purposes, we can think of as the set of remainders when dividing by . For example, , as the remainders when dividing by 3 are 0, 1, and 2. Moreover, the set is assumed to be equipped with the operations of addition and multiplication inherited from integer numbers via congruences modulo .