0

How to calculate $5^{2003}$ mod $13$

using fermats little theorem

5^13-1 1 mod 13

(5^12)^166+11 mod 13

a+b modn=(a modn + b modn) modn

(1+11mod13)mod13

12 mod 13 = 12

why answer is 8 ?

how do we calculate this

thanks

Did
  • 279,727
rektandlove
  • 11
  • 1
  • 5
  • 2
    Reducing the exponent modulo $12$ gives $5^{11}$ and because of $5^{12}\equiv 1\mod 13$ we simply have to invert $5$ modulo $13$ which easily gives $8$. – Peter May 20 '17 at 19:45
  • 2
    I think the fact that you haven't written down the second line correctly is confusing you. The "$+11$" takes part in the exponent, for instance, not separate from the whole power of $5$. Write it as $5^{12\cdot 166 + 11} = (5^{12})^{166}\cdot 5^{11}$, and it should be clearer. – Arthur May 20 '17 at 19:50
  • o yea so how we calculate 5^11 mod 13 ? – rektandlove May 20 '17 at 19:56
  • @rektandlove By hand? Do the first three or four powers of $5$ (making use of negative representatives modulo $13$ as well as positive), and the rest should be easy. – Arthur May 20 '17 at 19:57
  • alright 5^4 1 mod 13 so 11 will be 8 i got it ty – rektandlove May 20 '17 at 20:00
  • Good lord! "5^13-1 1 mod 13" Nobody hates MathJax more than I do, but can you make a minimal effort to make what you type legible. I honestly have no idea what this is supposed to be read as. $5^{13 -1} \equiv 1 \mod 13$ perhaps? Even typing it as 5^(13-1) = 1 mod 13 would have been an improvement – fleablood May 20 '17 at 20:18
  • Please read this tutorial on how to typeset mathematics on this site. – N. F. Taussig May 20 '17 at 21:23

2 Answers2

7

All modulo 13,

$$5^{2003} \equiv (5^{2})^{1001} (5)$$

$$\equiv (-1)^{1001}(5)$$

$$\equiv -5$$

$$\equiv 8$$

2

$5^{13-1}= 5^{12} \equiv 1 \mod 13$

$5^{2003} = 5^{12*166 +11} = (5^{12})^{166}*5^{11} \equiv 5^{11} \mod 13$

$5^{11}*5 = 5^{12}\equiv 1 \mod 13$

So if $5^{11} \equiv x \mod 13$ then $5^{11}$ is a solution to $5x \equiv 1 \mod 13$.

....

$5x \equiv 1,14,27,40 \mod 13$ so $5^{11} \equiv x\equiv 8 \equiv -5 \mod 13$.

.....

Or we could do $5^2 = 25 \equiv -1 \mod 13$ so $5^4 \equiv 1 \mod 13$ so $5^{11} \equiv 5^3 \equiv -5 \equiv 8 \mod 13$.

......

Those were trial and error. If we had to, we could use Euclid's algorithm to solve

$5x = 13k + 1$.

$5x = 10k + 3k + 1$

$5(x - 2k) = 3k + 1$. Let $v = x - 2k$

$5v = 3k + 1$

$3v + 2v = 3k + 1$

$3(v - k) + 2v = 1$ Let $w = v -k$

$3w + 2v = 1$

$w + 2(w+v) = 1$. Let $z = w+v$

$w + 2z = 1$. Let $z = 0; w = 1$

$z = w+v \implies 0 = 1 + v\implies v = -1$

$w = v-k\implies 1= - 1 -k\implies k = -2$

$v = x - 2k \implies -1 = x + 4 \implies x = -5$.

So $5^{11} \equiv x \equiv- 5 \equiv 8 \mod 13$.

fleablood
  • 124,253