1
$\begingroup$

I'm trying to use Wilson's theorem to simplify $(p - 2)! \mod p$, for a prime $p$. From the theorem it follows that it is equivalent to $\frac{1}{p - 1} \mod p$, but this isn't an integer so I'm not too sure what to do with it.

Is my deduction incorrect? Or am I just missing how to calculate the modulos of a fraction?

$\endgroup$
1
  • 2
    $\begingroup$ $p-1\equiv -1\pmod p$ so... $\endgroup$
    – lulu
    Oct 20 '16 at 15:30
3
$\begingroup$

By definition, $1/b\pmod{p}$ means the multiplicative inverse of $b$ in $\Bbb Z/(p)$. That is, $1/b$ is the element $u$ of $\Bbb Z/(p)$ such that $bu\equiv 1\pmod{p}$. In your case, you need to find an element $u$ such that $u(p-1)\equiv 1\pmod{p}$. But $p-1\equiv -1\pmod{p}$, so $u$ must be...

$\endgroup$
0
1
$\begingroup$

The value $\frac{1}{p-1}$ is probably more intuitive when written as $(p-1)^{-1}$, i.e. the number with which $p-1$ must be multiplied to obtain $1 \mod p$.

To simplify even further, note that $p-1 \equiv -1 \mod p$. What does this imply about the inverse of $p-1$?

$\endgroup$
1
$\begingroup$

I think you're overcomplicating things: $(p-1)!\equiv -1$ (mod $p$) by Wilson's theorem, and $p-1\equiv -1$ (mod $p$), so multiplying both sides by $-1$ we get $(p-2)!\equiv 1$ (mod $p$).

$\endgroup$
1
$\begingroup$

$\frac{1}{p-1}\equiv x\pmod p$ so $x(p-1)\equiv 1 \pmod p$ so
$-x\equiv 1\pmod p$ so $x\equiv -1\pmod p$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.