Mathematics of computer integers  Integers have typically a
fixed size in computers, for example 32 or 64 bits. Since there
are no such limits on the size of integers in mathematics, the
question arises: how do computer integers work, with respect to
mathematical theory?  The main problem with having a finite
number of bits is that we have a finite number of integers,
which means that if you keep adding 1s the sequence you get
1,2,3,4,… at some point starts to repeat. Still we’d like to
define addition and multiplication so that all the familiar
rules still hold: we expect that for every a, b, c we have
a+(b+c)=(a+b)+c, a*(b*c)=(a*b)*c, a*(b+c)=a*b+a*c, and so on.
Mathematical objects that do this are called rings.  A useful
way to define a finite ring of N elements is to take the
integers modulo N. Formally this works by defining an
equivalence relation for integers, where a and b are equivalent
when their difference is a multiple of N:  a ~ b if and only if
ab ≡ 0 (mod N).  For example, for N = 12, 7 ~ 19 b