-3

It seems to repeat every 6 values of $n$: \begin{align} 5^1 &\equiv 5 \pmod{7} \\ 5^2 &\equiv 4 \pmod{7} \\ 5^3 &\equiv 6 \pmod{7} \\ 5^4 &\equiv 2 \pmod{7} \\ 5^5 &\equiv 3 \pmod{7} \\ 5^6 &\equiv 1 \pmod{7} \\ 5^7 &\equiv 5 \pmod{7} \\ & \dots \end{align}

So it seems to depend on the divibility of $n$ by 6, but I can't figure out if there is a better pattern such as an expression in terms of $n$, or how to prove it more formally.

  • 4
    Can you state how much familiarity you have with modular arithmetic? EG From what you've shown here, one can conclude that since $5^6 \equiv 1 \pmod{7}$, hence $r^n$ repeats every 6 values ... – Calvin Lin Jun 19 '23 at 22:15
  • Mazel tov for spotting a pattern. Now, what is your question? – Adam Rubinson Jun 19 '23 at 22:49
  • 1
    @CalvinLin I am familiar with the basics of how modular arithmetic works, but not so much with any theorems other than Fermat's. I didn't think that it was because of $5^6$, but it makes sense. Thanks. – 2611throot Jun 19 '23 at 22:53
  • 1
    @AdamRubinson Is the pattern just that? there is no single expression in terms of $n$? Also, how can I prove this more formally? – 2611throot Jun 19 '23 at 22:56
  • 1
    Multiplying by $5^6$ doesn't seem to change the result, did you notice? – PC1 Jun 19 '23 at 23:04
  • Fermat's little theorem implies $5^6\equiv 1 \pmod{7}$ and so $ 5^{6k+c}\equiv 5^c \pmod{7}$ for all integers $k$ and c$ – Henry Jun 19 '23 at 23:11

1 Answers1

1

What you've discovered is called the multiplicative order of $5$ mod ($7$). It is the smallest integer $x$ such that $5^x\equiv 1 \mod(7)$. It is a fact that if $x$ exists for any particular congruence class mod(n) that $x$ must divide $\phi(n)$, which is Euler's totient function evaluated at n. If n is prime then this is simply equal to $n-1$ (as any prime is coprime to all numbers less than itself), and all congruence classes with a prime modulus are guaranteed to have a multiplicative order (more generally, if $a$ and $n$ are coprime, then $a^x \equiv 1 \mod(n)$ always has a solution). In your example $n=7$, which is prime, so the order of any element mod($7$) must divide $7-1=6$. Note that $\phi(n)$ may not always be equal to the multiplicative order, only that it must be divisible by it. For example, $2^3\equiv 1 \mod(7)$ and $3|\phi(7)$.