# Give the remainder when..

Give the remainder when you divide $3*(16!)+2$ by $17$.

I don't have much to go on, but i'm not asking you to simply give me the answer even though that would be great. Could someone show me where I could learn a method to go about solving this problem, and problems similar.

Thanks

-

Using Wilson's theorem $16!\equiv -1\pmod {17}$

So, $3\cdot (16!)+2\equiv 3(-1)+2\equiv -1\equiv 16\pmod {17}$

-
Makes sense, but what is the remainder? $16$? – student.llama Oct 16 '12 at 19:44
@student.llama, yes. – lab bhattacharjee Oct 17 '12 at 4:48

The operation of computing the remainder of a division of $a$ by $b$ is called modulo, and written $\text{mod}$. An important property of the modulo operation is that it commutes with addition and multiplication, in a way. You have that $$\begin{eqnarray} (a+b) \text{ mod } c &=& ((a \text{ mod } c) + (b \text{ mod } c)) \text{ mod } c \\ (a*b) \text{ mod } c &=& ((a \text{ mod } c) * (b \text{ mod } c)) \text{ mod } c \end{eqnarray}$$

Restated in these terms, the term you want to evaluate is $$3\cdot16! + 2 \text{ mod } 17$$ With the rules above you can simplify that to $$(3\cdot(16! \text{ mod } 17) + 2) \text{ mod } 17$$ Now, to evaluate $16! \text{ mod } 17$, you can either work recursively, i.e. split the product in half, evaluate each side (by using the same splitting technique) and then multiplying the result and applying module again. Or you can use the theorem that $(p-1)! \text{ mod } p = p-1$ if $p$ is a prime. With the second method, you immediate get $$3\cdot 16 + 2 \text{ mod } 17 = 16$$

-