Question: What is the remainder when $40!$ is divided by $1763$? 

---

**My try :**

Factorizarion of $1763 = 41 \* 43$

By using Wilson's theorem, I can say

$40! = -1 (mod 41) $

and $42.41.40! = -1(mod 43)$

=> $40! = -22(mod 43)$

---

How can I combine both the results ?

Answer: 
Basically the problem amounts to this: You have $x\equiv a\pmod m$, $x\equiv b\pmod n$, $\gcd(m,n)=1$, and you want to find the remainder when $x$ is divided by $mn$.

As $\gcd(m,n)$, there are integers $s,t$ such that $sm+tn=1$.

Multiplying $x=a+qm$ by $tn$ gives
$$tnx\ =\ tna+tqmn\ \ldots\ \fbox1$$
Multiplying $x=b+rn$ by $sm$ gives
$$smx\ =\ smb+srmn\ \ldots\ \fbox2$$
Adding $\fbox1$ and $\fbox2$ gives
$$x\ =\ (tna+smb)+(tq+sr)mn$$
So the remainder is $tna+smb\pmod{mn}$.
We have $21\cdot41-20\cdot43=1$.

$40!=41q\_1-1$ $\implies$ $(-20)\cdot43\cdot40!=-20\cdot1763q\_1+20\cdot43=1763Q\_1+860$

$40!=43q\_2-22$ $\implies$ $21\cdot41\cdot40!=21\cdot1763q\_2-21\cdot41\cdot22 = 21\cdot1763q\_2-18942=1763Q\_2+451$

Adding:

$(21\cdot41-20\cdot43)\cdot40!=1763(Q\_1+Q\_2)+860+451$

i.e. $40!\ =\ 1763Q+1311$

So the remainder is $1311$.