3

Prove that: $$(p - 1)! \equiv p - 1 \pmod{p(p - 1)}$$

In text it's not mentioned that $p$ is prime, but I checked and this doesn't hold for non-prime, so I guess $p$ is prime .. I know that $(p - 1)! \equiv -1 \equiv p - 1 \pmod p$, and $(p - 1)! \equiv 0 \equiv (p - 1) \pmod{p - 1}$, the problem is that I don't know how to combine these. Is it true that then we have: $(p - 1)! \equiv (p - 1)^2 = p^2 - p - p + 1 \equiv - p + 1 = - (p - 1) \pmod{p(p - 1)}$, which is not the desired result .. ? Or I need to multiply both sides of congruences ? What are the laws for congruences that allow me to do this ? (I hope you get the idea of what I'm trying to ask).

user10354138
  • 33,887
  • What you need is the so called Chinese Remainder Theorem: https://en.wikipedia.org/wiki/Chinese_remainder_theorem – Ingix Dec 20 '18 at 16:06
  • It's special case $,a=0,,b=-1$ (Wilson) of the simple CRT problem below, e.g. see Easy CRT

    $$\begin{align}& x\equiv a!!\pmod{p!-!1}\ &x\equiv b!!\pmod{p}\end{align} \iff x\equiv a + (p!-!1)(a!-!b) !!\pmod {p(p!-!1)}\qquad$$

    – Bill Dubuque Dec 06 '21 at 00:17
  • But if we only need to verify (vs. discover) the result then it is trivial: note that for $,x:= (p-1)!,$ we have that the congruence $,x\equiv p!-!1,$ holds both mod $,p,$ (by Wilson) and mod $,p!-!1,,$ hence it also holds mod their lcm=product $p(p!-!1)$ by CCRT = Constant-case CRT in the 2nd linked dupe. – Bill Dubuque Dec 06 '21 at 00:37
  • Or apply below $\ an\bmod ap =\ a(n\bmod p) =$ mod Distributive Law to factor out $,a=p!-!1,$

    $$(p!-!1)!\bmod (p!-!1)p ,=, (p!-!1)\underbrace{\left[{\dfrac{(p!-!1)!}{p!-!1}\bmod p}\right]}_{\textstyle\equiv (-1)/(-1)\equiv 1} =:! p!-!1\qquad\qquad\qquad\qquad\ $$

    – Bill Dubuque Dec 06 '21 at 00:54

2 Answers2

4

Apply Chinese remainder theorem to the coprime moduli $p$ and $p-1$.

However, if you can't use CRT, you can simply observe $(p-1)!-(p-1)$ is divisible by $p-1$ (obvious factor) and by $p$ (Wilson's), so it is divisible by their least common multiple $\operatorname{lcm}(p,p-1)=p(p-1)$.

user10354138
  • 33,887
0

1) Theorem. If $a|c$, $b|c$ and $(a,b)=1$ then $ab|c$

We know that $ (p,p-1)=1$ and also $p-1|(p-1)!-(p-1)$

By wilson theorem $p|(p-1)!+1$. Then $p|[(p-1)!+1]-p$

Therefore $p(p-1)| (p-1)!-(p-1)$