Definition
Given a positive integer \(n\) and an integer \(a\) coprime to \(n\), the multiplicative order of \(a\) modulo \(n\) is the smallest positive integer \(k\) such that
$$
\begin{align*}
a^k \equiv 1 \pmod{n}
\end{align*}
$$
Example
Suppose \(n = 7\) and \(a = 3\), then
$$
\begin{align*}
3^1 &= 3 \equiv 3 \pmod{n} \\
3^2 &= 6 \equiv 6 \pmod{n} \\
3^3 &= 9 \equiv 2 \pmod{n} \\
3^4 &= 81 \equiv 4 \pmod{n} \\
3^5 &= 243 \equiv 5 \pmod{n} \\
3^6 &= 729 \equiv 1 \pmod{n}
\end{align*}
$$
So the multiplicative order of \(3\) modulo \(7\) is \(6\). Similarly for \(a = 4\) and \(n = 7\)
$$
\begin{align*}
4^1 &= 4 \equiv 4 \pmod{n} \\
4^2 &= 16 \equiv 2 \pmod{n} \\
4^3 &= 64 \equiv 1 \pmod{n}
\end{align*}
$$
So the multiplicative order of \(4 modulo 7\) is 3.