-1

I want to prove that there exists $x, y \in \mathbb{Z_{\ge0}}$, $x ≠y$, s.t $a^x ≡ a^y \pmod{n}$.

The background to this question was that, I wanted to prove that modular exponentiation will repeat after some power.

I researched many times, but apparently the reason that seems the most appealing was that because after we reduce mod n, the reduced number will always be in the range $0 \le t < m$, so there must exist a repetition.

But I'm not convinced by this. How do you know after we reduce $a^x$, there will exist a residue of $a^y$ which is congruent to $a^x$?

For example, take $4^k \pmod{7}$. $4^0 ≡ 1 \pmod{7}$ $4^1 ≡ 4 \pmod{7}$ $4^2 ≡ 2 \pmod{7}$ $4^3 ≡ 1 \pmod{7}$

How do you know there will be another 1, 2, and 4? Why aren't there 3, 5, and 6 from the residues? For me, this cannot just be explained by just saying the residue will always be in the range $0 \le t < m$, so there will exist a repetition.

Bill Dubuque
  • 272,048
Hayst
  • 172

1 Answers1

2

There are some nuances here. As pointed out in the comments, if you just want to prove that there exist distinct positive integers $x, y$ such that $a^x \equiv a^y \bmod{n}$, then this follows from the Pigeonhole principle. Indeed, there are infinitely many positive integers and finitely many residue classes modulo $n$, so this argument is correct.

However, this certainly does not imply that the remainders are purely periodic. For instance, the remainders of the powers of $2$ modulo $12$ are given by $2, 4, 8, 4, 8, 4, 8, \ldots$ and you can see that although $2$ appears once, it does not appear again. In general, you can only conclude that the remainders are eventually periodic. This can be done because if $a^x \equiv a^y \bmod{n}$ where $y = x + k$ for some positive integer $k$, $a^m \equiv a^{m+k} \bmod{n}$ for all $m \geqslant x$ by induction.

One special case where the powers of $a$ are purely periodic modulo $n$ is when $(a, n) = 1$. In this case, you can conclude that if $a^x \equiv a^y \bmod{n}$, then $a^{x-1} \equiv a^{y-1} \bmod{n}$ because $a$ has a unique inverse modulo $n$. By backwards induction, you can prove that $a^k \equiv 1 \bmod{n}$ and hence, the powers of $a$ repeat every $k$ terms (of course, the period could be smaller).

Exercise: Prove that $a^m$ for non-negative integers $m$ are purely periodic modulo $n$ if and only if $(a, n) = 1$. When are they purely periodic for positive integers $m$?

Haran
  • 9,717
  • 1
  • 13
  • 47
  • Sorry, im not familiar with the pigeonhole principle. I dont know how my question follows from the pigeonhole principle. Could you elaborate? – Hayst Oct 29 '23 at 06:07
  • 1
    Please strive not to post more (dupe) answers to dupes of FAQs, cf. recent site policy announcement here – Bill Dubuque Oct 29 '23 at 06:20