Tabular display of \(ax \pmod{m}\) and \(a^x \pmod{m}\) for \(0 \le x < m\)

If \(gcd(a,m) = 1\), then multiplying \(a\) with elements in \(Z_m\) just permutes \(Z_m\). Because \(a^{-1}\) exists, \(ax \ne ay, \text{ if } x \ne y\).

And \(a^x\) forms a subgroup in \(Z_m^*\), whose order divides \(|Z_m^*|\). In particular, if \(m\) is prime, then the order divides \(m-1\).

a:
m: