Problem: Show that $2(n-1)! \equiv -1 \mod n+2 \iff n+2$ is a prime.

I know that Wilson's theorem states that $(n-1)! \equiv -1 \mod p $ for $p$ a prime, so that is the important thing to know with these type of problems.

I know that $-1 \equiv n+1 \mod n+2$ , and that if $n+2$ is prime, then $(n+1)! = -1 \mod n+2$. So this is all I have for now, any hints appreciated.

  • $\begingroup$ Well, what is $(n+1)\times n\pmod {n+2}$? $\endgroup$ – lulu Apr 19 at 20:59
  • $\begingroup$ @lulu $(-n) \mod n+2 $ $\endgroup$ – IntegrateThis Apr 19 at 20:59
  • $\begingroup$ Yes, and what is $n\pmod {n+2}$? $\endgroup$ – lulu Apr 19 at 21:00
  • $\begingroup$ @lulu -2 I believe. $\endgroup$ – IntegrateThis Apr 19 at 21:00
  • $\begingroup$ Yes, and what is $-1\times -2$? $\endgroup$ – lulu Apr 19 at 21:00

As per the comments since I know that $2 (n-1)! \equiv (-1)(-2)(n-1)! \equiv (n)(n+1)(n-1)! \equiv (n+1)! \equiv -1 \mod (n+2)$, then $n+2$ is prime.

  • 1
    $\begingroup$ Just to be clear: Wilson's Theorem plus the algebraic manipulation you provide just show one direction. Specifically: they show that $n+2$ prime $\implies 2(n-1)!\equiv -1 \pmod {n+2}$. You need to show the converse as well. However, that's pretty easy (Hint: if $n+2$ is composite then it has a non-trivial factor $<n-1$, at least for $n≥4$). $\endgroup$ – lulu Apr 19 at 21:27

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.