0
$\begingroup$

I have problem solving these two problems:

Let $p > 3$ be prime. Compute

  1. $(p-2)! \pmod p$
  2. $(p-3)! \pmod p$

We barely went over Wilson's theorem in class which states "Let $p$ be an integer greater than one. $p$ is prime if and only if $(p-1)! = -1 \pmod p$."

I don't really know how to use Wilson's theorem to problems. Any help would be appreciated! Thank you!

$\endgroup$

2 Answers 2

4
$\begingroup$

Hint. Let $x=(p-2)!$. Then $(p-1)x=(p-1)!$, so you have to solve the congruence $$(p-1)x\equiv-1\pmod p\ .$$ Can you do this?

Similarly, if $y=(p-3)!$ then you have to solve $$(p-2)(p-1)y\equiv-1\pmod p\ .$$

$\endgroup$
4
  • $\begingroup$ are both answers 1? $\endgroup$
    – Ashley
    Mar 18, 2016 at 1:49
  • $\begingroup$ No, the first is but not the second. $\endgroup$
    – David
    Mar 18, 2016 at 1:51
  • $\begingroup$ can you show me how to do the second one? $\endgroup$
    – Ashley
    Mar 18, 2016 at 1:54
  • $\begingroup$ Start by simplifying the LHS modulo $p$. $\endgroup$
    – David
    Mar 18, 2016 at 1:55
1
$\begingroup$

Hint:

$$(p-1)!=(p-1)(p-2)!$$

If you can find the inverse of $p-1$ then you're done.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .