Solving 50! mod 103 How to solve 50! mod 103?
Please give me a hint.
I have searched about various theorems but could not find solution.
 A: $50!=1\times2\times3\times\cdots\times48\times49\times50$
Note $103$ is prime hence $\varphi(103)=102$ and therefore $a^{102}\equiv1\mod103$ for $a\in\mathbb{Z}$ that are not multiples of $103$. This may help you reduce the product somewhat.
A: First notice that $103$ is a prime. Consider now the integers $1, 2, 3, ... \frac{103-1}{2}=51, \frac{103 + 1}{2}=52, ..., 102$. These are all the integers less than $103$. Can you see if they relate to each other nicely parewise $(\mathrm{mod} \ 103)$? If you can, form their product and equate it to 
$102! \ (\mathrm{mod} \ 103)$. Now use Wilson's theorem, and you should be able to find a nice result.
EDIT:
You will find $(51!)^2 \equiv 1 \ (\mathrm{mod} \ 103)$. As pointed out above, this, unfortunately, does not fully answer your question.
A: This can be computed in GAP using:
Factorial(50) mod 103;

which returns 2.

As far as I can tell, none of the earlier proposed methods will succeed (please correct me if I'm missing something).


*

*We compute $$50!=2^{47} \cdot 3^{22} \cdot 5^{12} \cdot 7^8 \cdot 11^4 \cdot 13^3 \cdot 17^2 \cdot 19^2 \cdot 23^2 \cdot 29 \cdot 31 \cdot 37 \cdot 41 \cdot 43 \cdot 47$$ where each exponent is less than $\varphi(103)$, so Euler's Theorem cannot be applied to simplify things.

*In the Wilson's Theorem approach, we obtain a square, which means we can only reduce the problem down to one of two possibilities, namely $\pm 2$, but which is it?
A: Hint: You can use Wilson Theorem and we know $102!\equiv -1 \mod103$ and $102!\equiv -(51!)^2 \mod103$ and therefore $1 \equiv 26\times (50!)^2 \mod103$. We can have   $4 \equiv  (50!)^2 \mod103$ which is:
$$
\pm 2 \equiv  50! \mod 103.
$$
However this cannot go further.
