Being $2011$ prime, calculate 2009! divided by 2011

modular arithmeticnumber theory

I'm working in the following excercise:

Being $2011$ prime, calculate $2009!$ divided by $2011$

By Wilson's theorem I have:

$$2010! \equiv -1 \mod 2011$$
$$2009! * 2010 \equiv -1 * 2010 \mod 2011$$
$$2009! \equiv -2010 \mod 2011 $$
$$2009! \equiv 1 \mod 2011$$

Checking the answer is correct but I'm not sure about step two, is that correct? any help will be really appreciated.

Best Answer

The right side on the second line should still be $-1$ because you just split the product on the left. Now note that $2010 \equiv -1 \pmod {2011}$ so multiply both sides by $2010$ $$2009! * 2010 \equiv -1 \pmod {2011}\\2009!\cdot 2010^2\equiv -1\cdot 2010 \pmod {2011}\\ 2009!\equiv 1 \pmod {2011}$$ You also just removed a factor $2010$ from the left between the second and third lines, which canceled out the error from the first to the second.