Equation:
$a^b \mod m$
for subsequent values of $b$ and $a$ produces a cycles.
For example: $m = 3$. We have $a > 1$ and $b > 4$ ($b$ is always large enough).
- $2^5 \equiv {\color{red}2} \pmod 3$
- $2^6 \equiv {\color{red}1} \pmod 3$
- successive power results will give you a cycle (2, 1, 2, 1 ...). We increase $a$ by one.
- $3^5 \equiv {\color{red}0} \pmod 3$
- successive power results will give you a cycle (0, 0 ...). We increase $a$ by one.
- $4^5 \equiv {\color{red}1} \pmod 3$
- successive power results will give you a cycle (1, 1 ...). We increase $a$ by one.
- $5^5 \equiv {\color{red}2} \pmod 3$
- $5^6 \equiv {\color{red}1} \pmod 3$
- successive power results will give you a cycle (2, 1, 2, 1 ...). We increase $a$ by one.
- $6^5 \equiv {\color{red}0} \pmod 3$
- successive power results will give you a cycle (0, 0 ...). We increase $a$ by one.
- ...
We can see that the cycle (marked in red) is: $(2, 1, 0, 1)$
The cycle size is 4.
Question: Can you prove that the cycle size for any modulo $m$ value will have a specified value? (or some upper limit on this value - but as precise as possible)
I hope I did not make any mistakes (but all is possible).
For example for $m = 16$ cycle size is $31$ (If I did not make a mistake.).