# Elementary Number Theory: Show the following congruence is true

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.

• 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. – lulu Nov 25 '18 at 21:22
• I'm not sure! I posted a screenshot of the exact question. – Stawbewwy Nov 25 '18 at 21:28
• Then there is a mistake in the exercise. It happens. – Jean-Claude Arbaut Nov 25 '18 at 21:28
• Well, I don't think I botched my counterexample (though of course I might have). – lulu Nov 25 '18 at 21:29
• 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$. – lulu Nov 25 '18 at 21:30

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$$.