What is the remainder when $p!$ is divided by $p+1$?

2.3k Views Asked by At

Let $p$ be a prime larger than $7$. What is the remainder when $p!$ is divided by $p+1$?

I tried plugging in the next prime (11), which doesn't help with such big numbers. Then I tried writing $\frac{p!}{p+1} = p(p-1)(p-2).../(p+1)$. Dividing each of $p$, $(p-1)$ etc individually by $(p+1)$, I always get $(p+1)$ as a remainder, and multiplying all those remainders together and dividing again by $p+1$ will give $0$, which I'm not sure is right. How can I solve this?

3

There are 3 best solutions below

3
On BEST ANSWER

Hint: Both $2$ and $(p+1)/2$ appear as factors in $p!$.

1
On

$p+1$ won't be a prime number. So $p+1=ab$ where $2\le a\le b\le p$. Obviously $a$ divides $p!$ and $b$ divides $p!$. Is it obvious that $ab$ divides $p!$? Is it even true?

2
On

Remember that if $p > 7$, then $p! = 1 \times 2 \times 3 \times \ldots \times (p - 1) \times p$.

The smallest prime factor of $p + 1$ is less than $\sqrt{p + 1}$ and clearly $\lceil \sqrt{p + 1} \rceil < p$. The largest prime factor of $p + 1$ is at most $\frac{p + 1}{2}$, which is also less than $p$.

This means that all the prime factors of $p + 1$ are included among the prime factors of $p!$, and in greater numbers. Therefore $(p + 1) \mid p!$.

For example, given $p = 11$, we have $p! = 39916800 = 2^8 \times 3^4 \times 5^2 \times 7 \times 11$. By contrast, $p + 1 = 12 = 2^2 \times 3^{(1)}$, so $$\frac{39916800}{12} = 3326400 = 2^6 \times 3^3 \times 5^2 \times 7 \times 11.$$