What is the order of $\bar{2}$ in the multiplicative group $\mathbb{Z}_{221}^\times$?
I keep computing $2^0, 2^1,...$ until we get $1\ (\operatorname{mod} 221)$, but this will take forever! Is there an easier way to do this? A hint that was given is that $221= 13 \times 17$.
The order of $2$ mod $13$ is $\color{blue}{12}$ because $2^{12}\equiv1\bmod13$ by Fermat's little theorem,
but $2^6=64\equiv-1\not\equiv1$ and $2^4=16\equiv3\not\equiv1\bmod13$.
The order of $2 $ mod $17$ is $\color{blue}8$ because $2^4=16\equiv-1\bmod17$, so $2^8\equiv(-1)^2\equiv1\bmod17$.
The order of $2$ mod $221$ is the least common multiple of $\color{blue}{12}$ and $\color{blue}8$.
See this Wikipedia article about the Carmichael function.