Why is there a pattern for $2^n=x \pmod {13}$ for all integers n? I was doing a question yesterday on very elementary number theory, and I came across this pattern.
$2^1=2 \pmod {13}$
$2^2=4 \pmod {13}$
$2^3=8 \pmod {13}$
$2^4=3 \pmod {13}$
$2^5=6 \pmod {13}$
$2^6=12 \pmod {13}$
$2^7=11 \pmod {13}$
$2^8=9 \pmod {13}$
$2^9=5 \pmod {13}$
$2^{10}=10 \pmod {13}$
$2^{11}=7 \pmod {13}$
$2^{12}=1 \pmod {13}$
$2^{13}=2 \pmod {13}$
I noticed the remainder always is unique for every block multiples of powers 13. And it repeats!.
Also I tried this for base 3 and base 4 base 5. All showed similar patterns.
Why? 

Simpler answer: For all these modulo questions, it is enough to find some exponent that gives a modulo of 1. Consider 
$2^n = 1 (mod 13)$ for some n. Then $2^{n + 1} = 2 (mod 13)$ which is same as $2^{0 + 1} = 2 (mod 13)$ and $2^{n + 2} = 4 (mod 13)$ which is $2^{1 + 1} = 4 (mod 13)$, in other words, they repeat. And also, notice that, if $2^n = k (mod 13)$ and $2^m = k (mod 13)$, then $2^{n - m} = 1 (mod 13)$ also. Since there are only 13 numbers below 13 that could be modulos, it is bound to repeat after some exponent n. 
Salahuddin
http://maths-on-line.blogspot.in/
