0

If p is a prime number, prove that gcd(p, (p-1)!) = 1

So, I've tried using the fact that 1 = px + (p-1)!y, where x,y are integers, but from there I'm stuck and don't really know how to work with the factorial term.

Ian Murphy
  • 196
  • 13

1 Answers1

0

If $p$ is prime, $d:=\gcd(p, (p-1)!) $ is a divisor of $p$. It is then $p$ or 1.

If it is $d=p$, $p = d|(p-1)!$ which means that $p$ appears in the prime decomposition of $(p-1)! = 1\times 2\times \dots \times (p-1)$.

But the biggest prime factor of $(p-1)!$, a product made with factors $<p$, is $<p$ as well. This a contradiction.


Note that the other implication is also true:

if $\gcd(p, (p-1)!) = 1$ then the biggest prime factor of $p$ is none of $1,2\dots (p-1)$, then it is $p$. Then $p$ is prime.

mookid
  • 28,236