Find the smallest positive integer N such that 13^N \equiv 1 \pmod{2013}.

2013 = 3*11*61

phi(2013) = 2*10*60 = 2^4*3*5^2

13^[phi(2013)/2] = 1

13^[phi(2013)/3] = 562

13^[phi(2013)/5] = 1

This means that

13^[phi(2013)/10] = 1

Dividing the exponent by 5 gives:

13^[phi(2013)/50] = 1831

So, we only need to try dividing the exponent of phi(2013)/10 by factors of 2 to see if we still get 1:

13^[phi(2013)/20] = 1

13^[phi(2013)/40] = 1

13^[phi(2013)/80] = -1

So, the order of 13 is phi(2013)/40 = 30