1

My attempt:

by Wilson's theorem, $(p-1)!=p⋅A-1$. Let $(p-2) !=p \cdot B+r$, where $0 \leq r<p$. Multiply the last equality by $(p-1)$:

$$(p-1) !=p \cdot B \cdot(p-1)+p \cdot r-r=p \cdot(B \cdot(p-1)+r)-r.$$

Comparing with the first equality, we get that $r=1$.

But my textbook says that $p-1$... Am I wrong?

Bill Dubuque
  • 282,220
CatMario
  • 398
  • 1
    The residue must be $0$ mod $p-1$ and $-1$ mod $p$ , hence $p-1$ is the correct result. – Peter Dec 05 '21 at 17:19
  • 1
    This is what you got as well, since $p\cdot r-r$ is $p-1$ , if $r=1$ – Peter Dec 05 '21 at 17:20
  • If you put $r=1$ in your last equation you do get the correct result, viz. $$(p!-!1)! = p(B(p!-!1)+1)-1 = B\color{#c00}{p(p!-!1)}+p-1\equiv p-1\pmod{\color{#c00}{p(p!-!1)}}\qquad$$

    A more general way to solve it is to use CRT - see the linked dupe.

    – Bill Dubuque Dec 06 '21 at 00:29

3 Answers3

1

You are not at all wrong. Because the answer required is not $r$. What is $r$? It is simply the remainder obtained when $(p-2)!$ is divided by $p$. But you are required to find the remainder obtained when $(p-1)!$ is divided by $p(p-1)$, which is clearly not $r$. You need to find the number $s$ such that $0\leq s < p(p-1)$ and that $$ (p-1)! \equiv s \pmod{p(p-1)}.$$

You have done it already. All you need is to note that $r=1$ (Why?). From your second equality it follows that $$(p-1)! = p(p-1)B + (p-1).$$ The above clearly implies that $s = p-1$.

Yathi
  • 2,859
0

Have a look at the Chinese remainder theorem. Look at the system where $x=(p-1)!$

$x=-1 \ (mod \ p)$ (follows from Wilson's theorem)

$x=0 \ \ (mod \ p-1)$

Then can you see what $x$ is? https://en.wikipedia.org/wiki/Chinese_remainder_theorem

user132
  • 56
0

We have $$-1\equiv(p-1)!=(p-2)!(p-1)\equiv(p-2)!(-1) \pmod p$$ so $(p-2)!\equiv 1\pmod p$ which means $(p-2)!=pk+1$. Multiply by $p-1$ to get $$(p-1)!=p(p-1)k+p-1$$ so the residue is $p-1$

jjagmath
  • 22,582
  • Please strive not to add more (dupe) answers to dupes of FAQs, cf. recent site policy announcement here. – Bill Dubuque Dec 06 '21 at 00:42
  • 1
    I think the person who asked the question required the rectification of the mistake in his answer than a way of solving this problem. In that sense I don't think the question is a duplicate one! – Yathi Dec 06 '21 at 04:01