[Math] Odd and (almost) even rows in the Pascal’s triangle

combinatorics

I came across the following proposition:

$\binom{n}{k}$ is even for all $1 ≤ k ≤ n-1$ iff $n=2^m$ for some $m \in \mathbb N$

$\binom{n}{k}$ is odd for all $0 ≤ k ≤ n$ iff $n=2^m-1$ for some $m \in \mathbb N_0$

I guess one could prove it using the Lucas' theorem or the neat fact that

$$
\mbox{(#Odd entries in } n^{th} \mbox{ row of Pascal's triangle)} = 2^{\mbox{(#1's in binary representation of $n$)}}
$$

Yet it seems to be an overkill in this case (and the book I use doesn't introduce the theorem). I wonder if there is a way to prove the proposition at hand directly.

Any help is appreciated.

Best Answer

It's easy to prove that $(1+x)^{2^m} = 1+x^{2^m}$ in $\mathbb Z_2[x]$ for all $m$ by induction.

Now you need to prove it is not true for $n$ not a power of $2$.

If $n=2^m q$ where $q>1$ is odd and $m\geq 0$ then $(1+x)^{2^mq}= (1+x^{2^m})^q = 1+qx^{2^m} +\dots$. Since $q$ is odd, that means that $\binom{n}{2^m}$ is odd.

This result generalizes to all primes $p$. If $\binom n k$ is divisible by $p$ for $1\leq k\leq n-1$ the $n=p^m$ for some $m$. Again you can prove by induction that $(1+x)^{p^m}=1+x^{p^m}$ in $\mathbb Z_p[x]$, again you prove that $\binom{p^mq}{p^m}\equiv q\pmod p$.