[Math] Find the smallest positive integer x such that 2015! ≡ x (mod 2017)

congruenceselementary-number-theorymodular arithmeticnumber theory

Q. The next year that is a prime is 2017. Find the smallest positive integer x such that
2015! ≡ x (mod 2017).

So, this is what I have;

By Wilson’s theorem, (2017-1)! ≡ -1 (mod 2017) ⇒ 2016! ≡ -1 (mod 2017) ⇒
2016∙2015! ≡ -1 (mod 2017) ⇒

not sure how to do the modular arithmetic to have just 2015! on the left side..

Best Answer

As $2017$ is prime, using Wilson's Theorem $$2016!\equiv-1\pmod{2017}$$

$$\iff 2015!\cdot 2016\equiv-1\pmod{2017}$$

$$\iff 2015!\cdot (-1)\equiv-1\pmod{2017}\text{ as }2016\equiv-1\pmod{2017}$$

So, $\cdots$

Related Question