Modular Arithmetic


§ Modular Arithmetic

Modular Arithmetic

For an integer pp, we can define x(modp)=z(modp)x \pmod{p} = z \pmod{p} to mean p(xz)p \vert (x - z). Often, for any number xx we represent it with the unique remainder xx' where 0x<p0 \leq x' \lt p. So,

x(modp)x.x \pmod{p} \equiv x'.

We say that xy(modm)x \equiv y \pmod{m} to say that the remainder of xx and yy after division by mm is the same, not that xx equals yy.

I use the notation anba \equiv_n b interchangably with the tradtional ab(modn)a \equiv b \pmod{n}.

§ Properties