Today we will learn about an interesting property of any power sequence:
$a^0,\ a^1,\ a^2,\ a^3...\ a^n$ $(mod\ P)$ where $a,\ n$ and $P$ are positive integers.
We will see how this works.
It is easy to see that $modulo\ P$ can give $P$ possible values $0,\ 1,\ 2...\ (P-1)$
Therefore, $a^n \pmod{P}$ will have to be any one of the values $0\ \to (P-1)$
Even if each of the values $a^0, a^1, a^2....\ a^{P-1}$ maps to a distinct number in the set $\{0,\ 1, 2...\ (P-1)\}$
Obviously the number $a^P$ will map to some number in the set, to which some previous power of $a$ has mapped. From this point on, that pattern will repeat.
We we take a couple of examples to understand this better.
Let us take the power sequence of $8^n$ $(mod\ 10)$.
We have learnt that $a \times b \pmod{P} \texttip{\equiv}{congruent to} (a \pmod{P}) \times (b \pmod{P})$
- If you take any integer $a$ and compute the power sequence $a^0,\ a^1,\ a^2 ...\ a^n$, and take the remainder of each of these powers after division by a fixed integer $P$, these remainders will follow a pattern.
- If the number $a$ and $P$ are coprime, then the pattern will repeat from $1$, however if they are not coprime, then the pattern will repeat from a number different from $1$.