Cycles of Powers of $2^n \bmod p$

534 Views Asked by At

Given some prime number $p$, create the set of all positive integers $\bmod p$ excluding $0$ to be $\mathbb{Z}_p^*$. We will now generate a group as follows, $$ G_p = \left\{2^n\bmod p\vert n\geq 0\right\} $$

Clearly the sequence of $2^n\bmod p$ must cycle by the pigeonhole principle, but I am concerned with the lengths of these cycles. For some primes $p$, the cycles span the entire set $\mathbb{Z}_p^*$. For example when $p=5$ then $$ 2^0\bmod 5 = 1 \\ 2^1\bmod 5 = 2 \\ 2^2\bmod 5 = 4 \\ 2^3\bmod 5 = 3. $$

However for the case of some other $p$, such as $p=23$ this is not the case. In fact $$ G_{23}=\{1,2,3,4,6,8,9,12,13,16,18\}. $$

An interesting observation that I've made is that let $k=|G_p|$, then it appears that there are always $\frac{p-1}{k}$ cycles, all of identical length $k$. My question is if anyone has any insight on proving this. I have an idea of how to do it if I knew that all sequences of $G_p$ would eventually return to $1$, however, I only know that a cycle must exist not what it hits

1

There are 1 best solutions below

0
On

Too big for a comment, but it gives some insight.

(I have published something similar as a problem in Mathematics Magazine some years ago.)
If $g=2$ is a primitive root $\pmod{p}$, then a cycle of length strictly less than $p-1$ always exists. (If it is not a primitive root it is obvious.)

Since $g=2$ is a primitive root of $p$ then $2^{\frac{p-1}{2}}\equiv p-1\pmod{p}$.

This is enough to show that $2^{\frac{p+1}{2}}\equiv2\cdot 2^{\frac{p-1}{2}}\equiv p-2\pmod{p}$.

Since $2^{p-2}\cdot 2=2^{p-1}\equiv p+1\pmod{p}$ we can see that $2^{p-2}\equiv \frac{p+1}{2}\pmod{p}$.

All these together yield: $2^{\frac{p+1}{2}}\equiv p-2 \pmod{p}$ and $2^{p-2}\equiv \frac{p+1}{2}\pmod{p}$.

So, there is cycle of length $2$. It is $(\frac{p+1}{2}\quad p-2)$ proving our claim.