Question: Let $p$ be prime, and suppose that $r$ is a positive integer less than $p$ such that $(−1)^rr! ≡ −1($mod $ p)$. Show that $(p − r + 1)! ≡ −1 ($mod $ p)$.

I'm not really sure what to do. My first strategy was to take $(−1)^rr!$, and expand it out. Doing so, we can get: $(-r)(-r+1)(-r+2)...(-2)(-1)$ My next assumption was to just add $p$ to all of these terms, but that doesn't get us what we want. Ultimately, it seems like we want to show $(p-r+1)(p-r)(p-r-1)(p-r-2)(2)(1)\equiv(−1)^rr!$ . There are more terms though potentially in $(p-r+1)!$ than $(−1)^rr!$, so I'm not really sure what to do. Perhaps connecting Wilson's theorem with the given? Hints would be greatly appreciated. Thanks!

Edit: Here's a screenshot directly from the book I am using.

The book is Elementary Number Theory, 6th edition by Kenneth H. Rosen.

enter image description here

  • 2
    $\begingroup$ Let $r=3,p=5$ and note that $(-1)^3\times3!=-6\equiv -1\pmod 5$ but $(5-3+1)!\equiv 3!\equiv 6\equiv 1\pmod 5$...so something seems off. $\endgroup$ – lulu Nov 25 '18 at 21:22
  • $\begingroup$ I'm not sure! I posted a screenshot of the exact question. $\endgroup$ – Stawbewwy Nov 25 '18 at 21:28
  • 2
    $\begingroup$ Then there is a mistake in the exercise. It happens. $\endgroup$ – Jean-Claude Arbaut Nov 25 '18 at 21:28
  • $\begingroup$ Well, I don't think I botched my counterexample (though of course I might have). $\endgroup$ – lulu Nov 25 '18 at 21:29
  • 1
    $\begingroup$ As another counterexample: $r=4,p=5$. We check that $(-1)^4\times 4!=24\equiv -1 \pmod 5$ but $(5-4+1)!=2!=2\pmod 5$. $\endgroup$ – lulu Nov 25 '18 at 21:30

Are you sure that what you are trying to prove is even true? Below you can find a counterexample to your problem.

Let $p$ be a prime and let $r=1$. Then it is always the case that $(-1)^rr!\equiv-1\bmod p$, but $(p-r+1)!\equiv p!\equiv 0 \bmod p$.

Just in case anyone wants a second counterexample, since $r=1$ feels kind of silly...

Let $p$ be a prime greater than $3$, and let $r=p-1$. Then it is always the case that $(-1)^rr!\equiv(p-1)!\equiv-1\bmod p$ by Wilson's Theorem, but $(p-r+1)!\equiv 2!\equiv 2 \bmod p$.


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.