The order $k$ of a number $\beta$ in $Z_n$ is the smallest power where $\beta^k mod n === 1$

_e.g. ord13(9): ord of 9 in ℤ13 => 3