I'm trying to solve current task referenced the following but I stuck at $\displaystyle77^{17}\equiv x\pmod{100}$. As it is described on above link it uses Binomial Theorem. But I read a lot about the theorem, find it hard to figure out. Could you please explain to me step by step how to solve it by the binomial theorem.
- 117
-
2These are small enough numbers that you can do it just be repeated squaring (or, to be more precise, square-and-multiply). $$77^2\equiv 29\pmod{100},$$ $$77^4\equiv 29^2\pmod{100},$$ up to $77^{16}$. Then multiply that by $77$. – Jyrki Lahtonen Jun 24 '15 at 09:26
-
http://math.stackexchange.com/questions/623008/determination-of-the-last-two-digits-of-777777?rq=1 – Pratyush Jun 24 '15 at 09:26
6 Answers
The idea is to realize that $77=7\times 10+7$. Why is this important in the present question? It is indeed a question about the binomial theorem, it says that :
$$(a+b)^n=\sum_{k=0}^n\begin{pmatrix}n\\k\end{pmatrix}a^kb^{n-k} $$
Now applying this with $a:=7\times 10$, $b:=7$ and $n=17$ we have that :
$$77^{17}=\sum_{k=0}^{17}\begin{pmatrix}17\\k\end{pmatrix}7^k10^k7^{17-k} $$
$$77^{17}=7^{17}\sum_{k=0}^{17}\begin{pmatrix}17\\k\end{pmatrix}10^k $$
Now if $k\geq 2$ then $\begin{pmatrix}17\\k\end{pmatrix}10^k$ is divisible by $100$ hence, mod $100$ you have :
$$77^{17}=7^{17}\sum_{k=0}^{1}\begin{pmatrix}17\\k\end{pmatrix}10^k\text{ mod } 100 $$
$$77^{17}=7^{17}(1+17\times 10)\text{ mod } 100 $$
$$77^{17}=7^{17}+7^{18}.10\text{ mod } 100 $$
Now $7^{18}=(-3)^{18}=(-1)^9=-1=9$ mod $10$ Hence :
$$77^{17}=7^{17}+90\text{ mod } 100 $$
Finally $7^2=50-1$ hence mod $100$ we have $(7^2)^8=(50-1)^8=1$ (here I used again the binomial theorem). This means that $7^{17}=7$ whence :
$$77^{17}=97\text{ mod } 100 $$
Edit: you asked how to do it with the binomial theorem so this is an answer with this binomial theorem. However the answer from azimut using dichotomic expansion is (in the present situation) more efficient...
- 11,721
-
Thank you a lot. But sorry It is little bit difficult to me to figure out – golondrino Jun 24 '15 at 10:00
-
$$77^{17}=7^{17}(1+17\times 10)\text{ mod } 100 $$ How did it come from? – golondrino Jun 24 '15 at 10:05
-
If you agree with $77^{17}=\sum_{k=0}^{17}\begin{pmatrix}17\k\end{pmatrix}7^k10^k7^{17-k} $ then in the summand you have $7^k10^k7^{17-k}=10^k7^{17}$ hence you can take the $7^{17}$ out of the sum (it does not depend on $k$ anymore) hence you have $77^{17}=7^{17}\sum_{k=0}^{17}\begin{pmatrix}17\k\end{pmatrix}10^k$ now mod $100$ all the terms for $k\geq 2$ will vanish this leaves $7^{17}(\text{term for } k=0+\text{term for } k=1)$ which is exactly $7^{17}(1+17\times 10)$. – Clément Guérin Jun 24 '15 at 10:14
I suggest computing the value by iterated squaring. $$ 77^2 \equiv (-23)^2 = 529 \equiv 29 \mod 100 \\ 77^4 = (77^2)^2 \equiv 29^2 = 841 \equiv 41 \mod 100 \\ 77^8 = (77^4)^2 \equiv 41^2 = 1681 \equiv 81 \mod 100 \\ 77^{16} = (77^8)^2 \equiv 81^2 \equiv (-19)^2 = 361 \equiv 61 \mod 100 $$ Now $$ 77^{17} = 77^{16} \cdot 77 \equiv 61 \cdot 77 \equiv (-39)\cdot (-23) = 897 \equiv 97 \mod 100 $$
- 24,316
-
-
@golondrino: Why would you want to use binomial theorem here? You would still need to calculate the remainder of $7^{17}$ separately, no? – Jyrki Lahtonen Jun 24 '15 at 09:35
-
Yes, you are right. But I want to learn to do it by binomial theorem – golondrino Jun 24 '15 at 09:39
-
@golondrino: I see. For the binomial version, see the answer Clément Guérin. Still, I think for your concrete example the iterated squaring method is 1) more efficient, 2) more direct and systematic and 3) easier to understand. – azimut Jun 24 '15 at 09:57
Using Binomial:
$$77^{17} = (80-3)^{17} = \sum_{k=0}^n{17 \choose k}80^{17-k}(-3)^k \equiv (-3)^{17}+17\cdot80\cdot(-3)^{16} \\ \equiv (17\cdot80-3)\cdot 3^{16} \equiv 57 \cdot 3^{16}\equiv 57 \cdot 81^{4} \equiv 57 \cdot 19^{4} \equiv 57 \cdot 61^{2} \equiv 97 \mod 100$$
Using Carmichael:
Another approach is using the Carmichael theorem, this gives $77^{20} \equiv 1 \mod 100$. Now we want to multiply trice by the multiplicative inverse of $77$ mod 100, which is 13, so $$77^{17} = 77^{20}(77^{-3}) \equiv 13^3 = 2197 \equiv 97 \mod 100$$
- 25,726
-
-
-
Sorry but I'm not familiar with multiplicative inverse. Could you be more specific, e.g. how to calculate multiplicative inverse? – golondrino Jun 24 '15 at 09:46
-
You can do it using the Extended Euclidean algorithm, but I just used s spreadsheet to calculate it quickly. – wythagoras Jun 24 '15 at 09:52
-
$(-3)^{17}+17\cdot80\cdot(-3)^{16}$ Where this come from? Could you explain please? – golondrino Jun 24 '15 at 10:20
-
$100=4\cdot25$
$77\equiv1\pmod4\implies77^n\equiv1^n\equiv1\ \ \ \ (1)$
$77\equiv2\pmod{25}\implies77^{17}\equiv2^{17}$
Now $2^{20}\equiv1\pmod{25}\implies2^{17}\equiv2^{-3}\equiv-3\equiv22 \ \ \ \ (2)$
Apply CRT on $(1),(2)$
Or by observation, $77^{17}\equiv97\pmod{4\cdot25}$
- 279,016
-
-
1
-
@Iab bhattacharjee: I agree with your values mod. $4$ and mod. $25$. As $25-6\cdot 6=1$, you have $,x\equiv 1\cdot25-(-3)\cdot6\cdot 4=97 \mod 100$. – Bernard Jun 24 '15 at 12:18
As $77^2\equiv29\pmod{100}\equiv30-1$
$77^{17}=77(77^2)^8\equiv77(-1+30)^8\pmod{100}$
Now $(-1+30)^8\equiv(-1)^8+\binom81(-1)^730^1\pmod{100}\equiv-239\equiv61$
$61\cdot77=(60+1)(70+7)\equiv420+70+7\equiv97\pmod{100}$
- 279,016
-
You meant $77^{17} = \color{red}{7}7(77^{2})^8$ in the second line. – N. F. Taussig Jun 25 '15 at 20:50
-
As $77=7\cdot11,77^{17}=7^{17}\cdot11^{17}$
Now $11^{17}=(1+10)^{17}\equiv1^{17}+\binom{17}11^{16}10^1\pmod{100}\equiv1+17\cdot10\equiv71$
and $7^2=50-1\implies7^4=(50-1)^2\equiv1\pmod{100}$
$\implies7^{17}=7(7^4)^4\equiv7\cdot1^4\pmod{100}\equiv7$
$\implies77^{17}\equiv71\cdot7\equiv497$
- 279,016