2

Firstly, the question starts with Fermat's Theorem:

  • $5^{2017}$ (mod 7) (mod 11) (mod 13) = ?

I have computed all of them and the answer is (in order): (5, 3, 5).

Secondly, the question asks to compute the below problem using The Chinese Remainder Theorem:

  • $5^{2017}$ (mod 1001) = ? (while actually $7*11*13 = 1001$)

What I did is:

  • mod 7            mod 11            mod 13

$x$ =  $11*13$            $7*13$             $7*11$

$x \equiv 143 \;(\bmod\;7)$

$x \equiv 91 \;(\bmod\; 11)$

$x \equiv 77 \;(\bmod\; 13)$

Therefore:

$x \equiv 3 \;(\bmod\; 7)$

$x \equiv 3 \;(\bmod\; 11)$

$x \equiv 12 \;(\bmod\; 13)$

$x = (B1*X1*C1) + (B2*X2*C2) + (B3*X3*C3)$

Therefore:

$x = (143*3*5) + (91*3*3) + (77*12*5) = 7584$

So, where did I do a mistake?

2 Answers2

1

1) Fermat's little theorem say that if $\gcd(5,p) = 1$ and $p $ is prime that $5^{p-1} \equiv 1 \pmod p$.

So $5^6\equiv 1 \pmod 7$ and $5^{10}\equiv 1 \pmod {11}$ and $5^{13}\equiv 1 \pmod {13}$.

So if $2107 = 6k + r$ then $5^{2017}=5^{6k+r}=(5^6)^k*5^r \equiv 1^k*5^r\equiv 5^r\pmod 7$.

So that this how you solve $5^{2017}\pmod {7}$. Do the the same for $11,13$.

.....

So now you have $5^{2017}\equiv a \pmod 7$ and $5^{2017}\equiv b \pmod {11}$ and $5^{2017}\equiv c \pmod {11}$.

So the chinese remainder theorem says there is a single unique solution to $5^{2017}\equiv x \pmod {7*11*13}$ that satisfies $x \equiv a \pmod 7$ and $x \equiv b \pmod {11}$ and $c\equiv \pmod 13$.

And the chinese remainder shows you how to find it.

$7j + 13m =1$ has a solution. FInd it.

So $7bj + 11am = N$ will be so that $N\equiv 7bj + 11am \equiv 7bj +11bm \equiv b\pmod {11}$ and $N\equiv 7bj + 11am \equiv 7aj + 11am \equiv a \pmod 7$.

And

$77k + 13p= 1$ also has a solution. Find it.

So $77ck + 13Np = M$ will be so that $M\equiv 91ck + 13cp \equiv c\pmod{13}$ while $M\equiv 77Nk + 13Np \equiv N \equiv a \pmod 7$ and $M\equiv N\equiv b \pmod {11}$.

So $5^{2017}\equiv M \pmod {1001}$

.....

So you have $5^{2017} \equiv 5 \pmod 7$ and $5^{2017}\equiv 3 \pmod 11$.

I figure that $2*11 - 3*7 = 1$

And so $2*11*5 - 3*7*3 = 47$ and

$47\equiv 2*11*5 - 3*7*3 \equiv 2*11*5- 3*7*5\pmod 7\equiv 5\pmod 7$.

And $47 \equiv 2*11*5 - 3*7*3 \equiv 2*11*3 - 3*7*3 \equiv 3\pmod {11}$.

....

Now do the same thing with $47\pmod {77}$ and $5\pmod {13}$

Use $6*13 - 77 =1$.

To get $6*13*47 - 5*77 = 3281 = 278+3003 \equiv 278 \pmod{1001}$.

fleablood
  • 124,253
1

The mistake is that you forgot to take inverses. We want

$\quad \bmod 7\!:\ \ \ 1/(11\cdot 13)\equiv 1/3\equiv -6/3\equiv \color{#c00}{-2}$

$\quad \bmod 11\!:\,\ 1/(7\cdot 13)\equiv 1/3\equiv 12/3\equiv \color{#0a0}4$

$\quad \bmod 13\!:\!\,\ 1/(7\cdot 11)\equiv 1/(-1)\equiv \color{#90f}{-1}$

so $\,\ x\equiv 5\,\underbrace{(11\cdot 13)(\color{#c00}{-2})}_{\textstyle \equiv 1\pmod{\!7}}\ +\ 3\!\!\!\!\! \underbrace{(7\cdot 13)\,\color{#0a0} 4}_{\textstyle \equiv 1\pmod{\!11}}\!\!\!\! +\ 5\!\!\underbrace{(7\cdot 11)(\color{#90f}{-1})}_{\textstyle \equiv 1\pmod{\!13}}\! = -723 \equiv 278\pmod{\!1001}$


But it is much easier to solve the congruences two-at-a-time as below:

Note $\, x\equiv 5\pmod{\!7\ \&\ 13}\!\iff\! x\equiv 5\pmod{\!91}\,$ so $\,x = \color{#0a0}{5\! +\! 91k}\ $ by CCRT = constant case CRT.

so $\bmod \color{#c00}{11}\!:\,\ 3\equiv x\equiv \color{#0a0}{5 + 91}\,\color{#c00}k\equiv 5+3k\iff 3k\equiv -2\equiv 9\iff \color{#c00}{k\equiv 3}$

Thus we conclude $\,\ x = 5 + 91(\color{#c00}{3\!+\!11n}) = \bbox[5px,border:1px solid #c00]{278 + 1001n}\ \,$ Took $1$ minute of mental arithmetic.

Bill Dubuque
  • 272,048