Find the remainder when dividing $2016^{{2017}^{2018}}$ with $77$. I know how to do this when $\textrm{gcd}(2016,77) = 1$, but that is not the case here, so I can't use Euler's theorem (https://en.wikipedia.org/wiki/Euler%27s_theorem). What should I do with this?
-
1Use the Chinese Remainder Theorem. – aschepler Nov 26 '22 at 20:38
-
how should I use that? – smth Nov 26 '22 at 20:45
-
@smth Observe that $7 , | , 2016$ so pretty much obvious what happens there. Now use Euler's theorem (or Fermat's theorem) with $p=11$. Then as "aschelper" pointed out, use CRT. – Anurag A Nov 26 '22 at 20:51
-
1"how should I use [Chinese Remainder Theorem]?" By finding the remainder of $x=2016^{2017^{2018}}\equiv r \pmod 7$ with $7$ and the remainder of $x = 2016^{2017^{2018}}\equiv s \pmod {11}$. Then use CRT to solve $x \equiv r\pmod 7$ and $x\equiv s\pmod{11}$. – fleablood Nov 27 '22 at 01:13
-
Exacly as here in the 3rd linked dupe, or here in the 4th, or here in the 5th, this is a straightforward mechanical computation using basic methods (see the CW answer below for details). We have many tens (if not hundreds) of such calculations in prior answers so I am closing this as a dupe (there is nothing novel here). – Bill Dubuque Nov 27 '22 at 08:43
2 Answers
Since $7\mid 2016$ we will have $2016^{2017^{2018}}\equiv 0\pmod7$, so we only need $2016^{2017^{2018}}\pmod {11}$, by the Chinese remainder theorem.
By Fermat's little theorem, we can reduce the exponent $2017^{2018}$ $\pmod{10}$. Then we get $7^{2018}\pmod{10}$. By Euler's theorem since $\varphi (10)=4$, we can reduce the exponent $\pmod4$. But $2018\equiv 2\pmod4$.
Thus we get $7^2=49\equiv-1$.
So we have $2016^{-1}\pmod {11}\ \equiv 3^{-1}\equiv 4\pmod {11}$.
Now returning to CRT, and putting it together with Bezout coefficients, we get that since $$-3×7+2×11=1$$, that $-3×7×4+0×2×11=-84\equiv 70\pmod{77}$ is our solution.

- 8,427
-
Please strive not to post more (dupe) answers to dupes of FAQs, cf. recent site policy announcement here. – Bill Dubuque Nov 27 '22 at 08:37
-
The Fermat and Euler theorems alone do not imply that we can reduce exponents that way, rather that is a consequence of another theorem (mod order reduction) combined with those theorems. Also you skipped many steps - some of which may not be clear to beginners. – Bill Dubuque Nov 27 '22 at 08:40
It's a mechanical calculation using mod order reduction to reduce $\rm\color{#0a0}{expo}\color{darkorange}{nents}$ mod Euler $\phi,\,$ and also that: $\,\ n\bmod 77 = 7\left[\dfrac{\color{#c00}n}7\bmod 11\right]\,$ if $\,7\:\!|\:\!n\ $ [mod distributive law = $\rm\color{#90f}{MDL}$ = CRT] as below
$\bmod 77\!:\ 2016^{2017^{2018}}\!\! \equiv 7\overbrace{\left[\dfrac{\bbox[5px,border:1px solid #c00]{\color{#c00}{2016^{\color{#0a0}{2017^{\color{darkorange}{2018}}}}}}}7\bmod 11\right]}^{\textstyle\bbox[5px,border:1px solid #c00]{\color{#c00}4}/7\equiv 4/(-4)\equiv -1}\!\! \equiv 7[-1]\ $ by $\rm\color{#90f}{MDL}$ & reduce $\bbox[1px,border:1px solid #c00]{\rm\color{#c00}{top}}$ as below
$\bmod 11\!:\ \bbox[5px,border:1px solid #c00]{\color{#c00}{2016^{\,\bbox[3px,border:1px solid #0a0]{\color{#0a0}{2017^{\color{darkorange}{2018}}}}}}}\equiv 3^{\,\bbox[1px,border:1px solid #0a0]{\color{#0a0}{-1}}}\equiv \dfrac{1}{3}\equiv \dfrac{12}3\equiv\bbox[5px,border:1px solid #c00]{\color{#c00}4}\, $ by reduce $\rm\bbox[1px,border:1px solid #0a0]{\color{#0a0}{expt}}$ mod $\phi(11)\!=\!10$ as below
$\bmod 10\!:\ \bbox[5px,border:1px solid #0a0]{\color{#0a0}{2017^{\,\bbox[1px,border:1px solid darkorange]{\color{darkorange}{2018}}}}}\equiv \color{#0a0}7^{\,\bbox[1px,border:1px solid darkorange]{\color{darkorange}2}}\equiv \bbox[5px,border:1px solid #0a0]{\color{#0a0}{\!\!\!-1}}\, $ by reduce $\bbox[1px,border:1px solid #c00]{\rm\color{darkorange}{expt}}$ mod $\phi(10)\!=\!4,\,$ i.e. $\,\bbox[3px,border:1px solid darkorange]{\color{darkorange}{2018}}\equiv_4 \bbox[2px,border:1px solid darkorange]{\color{darkorange}2}$
We computed the modular fractions $\frac{4}7,\ \frac{1}3\bmod 11$ via twiddling or inverse reciprocity.
Generally $\,\ {{\color{#c00}{\underbrace{(14\!+\!77i)}_{\!\!\!\!\!\!\!\!\!\!\!\!2016\ \equiv\ 14\pmod{\!77}}}^{\!\color{#0a0}{\large (\pm7+10j)^{\LARGE\color{darkorange}{2+4k}}}}}}\!\equiv -7\pmod{\!77}\ $ exactly as above.
Above we have $\ \color{#c00}{\frac{77}7\!=\! 11}\overset{\phi}\to \color{#0a0}{10} \overset{\phi}\to \color{darkorange}4\ $ are the mod expt reductions recursively applied in the tower.

- 272,048
-
Dupe closing remark too long for a comment so posted it as CW (calculation is repeated in the linked dupe as an example, so nothing is lost if this dupe thread is deleted). – Bill Dubuque Nov 27 '22 at 09:08
-