How to prove that $\frac{1000!}{(500!)^2}$ is not divisible by 7?

This is overkill, but by Lucas's Theorem$$\frac{1000!}{(500!)^2}=\binom{1000}{500} \equiv \binom{2}{1}\binom{6}{3}\binom{2}{1}\binom{6}{3} \equiv 4 \pmod{7}$$ As $1000=2626_{7}$ and $500=1313_{7}$.

Here is another , more elementary argument, from Legendre's formula, $$\nu_7(n!) = \frac{n - s_7(n)}{6}$$ So $\nu_7(100!)=164, \nu_7 (50!)=82$. So the $7$ s in the denominator and the numerator cancel out. So we have the desired result.


It is a general formula that the number of times a prime $p$ occurs in the prime factorisation of $n!$ is given by

$$ \left[\frac{n}{p}\right] + \left[\frac{n}{p^2}\right] + \left[\frac{n}{p^3}\right] + \cdots $$

where $[x]$ denotes the greatest integer $≤x$.

In $1000!$ you'd have

$$ \left[\frac{1000}{7}\right] + \left[\frac{1000}{7^2}\right] + \left[\frac{1000}{7^3}\right] + \cdots = 164 $$

$7$'s, and in $500!$ you have

$$ \left[\frac{500}{7}\right] + \left[\frac{500}{7^2}\right] + \left[\frac{500}{7^3}\right] + \cdots = 82 $$

$7$'s. So you'll have a total of $164$ 7's in $(500!)^2$.

The rest follows.


You can also overkill it by Kummer's theorem:

Notice that $500$ is $1313$ in base $7$. Since every digit is smaller than $\frac{7}{2}$ there are no carries when adding $1313+1313$ in base $7$.

Therefore $\binom{1000}{500}$ is not a multiple of $7$.


In general we have that a prime $p$ divides $\binom{2n}{n}$ if and only if $n$ has at least one digit larger than or equal to $p/2$ in its base $p$ expansion.