how to find remainder when $20! + 20^{23}$ is divided by $23$?

2.4k Views Asked by At

how to find remainder when $20! + 20^{23}$ is divided by $23$?

I am finding it bit difficult to solve. Does any one has a simpler way to solve this problem??

2

There are 2 best solutions below

0
On

Note that $$a^p\equiv a\mod p$$ for any prime $p$, and any $a$.

Moreover, by Wilson's theorem, $$(p-1)! \equiv -1\mod p$$ for any prime $p$.

Take $p=23$.

SPOILER

First, we have $-1 \equiv 22!=22\cdot 21\cdot 20!\equiv -1\cdot21\cdot20! \mod 23$, since $22\equiv -1$. By using Euclid's algorithm, $21\cdot 11-23\cdot 10=1$. Then $ 20!\equiv 11\mod 23$ and since $20^{23}\equiv 20\mod 23$ summing gives $20^{23}+20!\equiv 20+11=31\equiv 8\mod 23 $.

4
On

Hints: doing arithmetic modulo $\,23\,$:

$$\begin{align*}\bullet&\;\;\;22!=-1\implies 20!=\frac{22!}{21\cdot22}=\frac{-1}{(-2)(-1)}=-\frac12=-12=11\\ \bullet&\;\;\;20^{23}=20=-3\end{align*}$$