Powers of primes mod n having period two

64 Views Asked by At

Suppose $p$ is prime. What is the largest $n$, say $n_{max}$, such that the sequence $p^1 \mod n, p^2 \mod n, p^3 \mod n, ...$ has period two? It seems the sequence of $n_{max}$'s starts out as follows: $24, 216, 3000, 16464$ for $p=2,3,5,7$.

1

There are 1 best solutions below

0
On BEST ANSWER

If $n=p^{k+2}-p^{k}$ then $p^{k+2}\equiv p^k \pmod n$

and thus $p^{k+2+m}=p^{k+2}p^m\equiv p^kp^m=p^{k+m} \pmod n$ for all integers $m \ge 0,$

so the powers of $p$ starting with $p^k$ will repeat with period $2 \pmod n.$

So in fact there is no maximum modulus for which the powers of $p$ will repeat with period 2,

since this holds for any integer $k \ge 0$.


(The moduli you gave are the case $k=3$.)