Pascal's Triangle and Binary Representations

Another approach uses generating functions (for a similar example, see the proof of Lucas's Theorem). Let $p(x) = \sum_{k=0}^n\binom{n}{k}x^k$. It is easy to check that for primes $p$ and nonnegative integers $k$, we have $(1+x)^{p^k}\equiv 1 + x^{p^k}\pmod p$. Then $$p(x) = (1+x)^n = \prod_{i=0}^t \left((1+x)^{2^i}\right)^{b_i} \equiv \prod_{i=0}^t \left(1+x^{2^i}\right)^{b_i}\pmod 2.$$ Thus $\binom{n}{2^j}$ is congruent to the coefficient of $x^{2^j}$ in $\prod_{i=0}^t \left(1+x^{2^i}\right)^{b_i}$ mod $2$. Since all the $b_i$ are 0 or 1, the coefficient of $x^{k}$ in $\prod_{i=0}^t \left(1+x^{2^i}\right)^{b_i}$ is the number of ways to write $k=2^{i_1}+2^{i_2}+\cdots+2^{i_m}$ for some $i_1<i_2<\cdots<i_m$ where $b_{i_1}=b_{i_2}=\cdots=b_{i_m} = 1$. Since binary representation is unique, all the coefficients of $\prod_{i=0}^t \left(1+x^{2^i}\right)^{b_i}$ are 0 or 1. In particular, the coefficient of $x^{2^j}$ is 1 if $b_j=1$ and 0 if $b_j=0$, so we have $b_j\equiv \binom{n}{2^j}\pmod 2$.

I believe by the same argument you can show for all primes $p$, writing $n=\overline{b_tb_{t-1}\dots b_0}_p$ in base $p$, we have $$b_j\equiv\binom{n}{p^j}\pmod p. $$

EDIT: For this problem and the problem for general $p$ you can actually can just apply Lucas's Theorem directly: $$\binom{n}{p^j} \equiv \prod_{i=0}^t\binom{b_i}{[i=j]}\equiv b_j\pmod p$$ where we denote $[i=j]$ to be 1 if $i=j$ and 0 otherwise.


Not sure that it could be a simpler approach, but an alternative way to show it could be to look at the patterns of the diagonals expressing the $\binom {n}{2^i} $ coefficiens for a given $i $ (that you correctly highlighted by colors in the triangle), and to show that they are identical to the patterns followed by the $i^{th}$ digit (from the right) of the sequence of binary numbers.

For example, it is straightforward to note that the $1^{st} $ digit from the right (i.e. the last) in the sequence of binary numbers follows an alternating pattern $10101010...$ with period $2$, reflecting the behaviour of the progressive increasing numbers $\mod 2$. An identical pattern is followed by the diagonal expressing the $\binom {n}{1} \mod 2 $ coefficients (or equivalently the $\binom {n}{n-1} \mod 2$ coefficients), since they corresponds to the sequence $n \mod 2$.

Generalizing, the $i^{th} $ digit from the right in the sequence of binary numbers follows an alternating pattern with period $2^i$ in which the first $2^{i-1}$ elements are $1$ and the second $2^{i-1}$ elements are $0$. This can be showed by observing that, for any binary number $K $, if the quantity $K \mod 2^i $ is $<2^{i-1} $ then the $i^{th} $ digit from the right must necessary be $0$, whereas if $K \mod 2^i $ is $\geq 2^{i-1} $ then the $i^{th} $ digit from the right must necessary be $1$. Also, since in the sequence of binary numbers the $i^{th} $ digit from the right compares for the first time at $2^{i-1}$, the sequence starts with $1$.

A similar pattern exists for the diagonal expressing the $\displaystyle \binom {n}{2^{i-1}} \mod 2 $ coefficients, or equivalently the $\displaystyle \binom {n}{n-2^{i-1}} \mod 2$ coefficients. These diagonals start at $n= 2^{i-1}$ and, in the original Pascal's triangle (non $\mod 2$) have coefficients corresponding to the sequence $\binom {n}{2^{i-1}}$ for given $i$ and increasing $n$. This sequence can be written as

$$1$$ $$n+1$$ $$\frac { (n+1)(n+2)}{2}$$ $$\frac {(n+1)(n+2)(n+3)}{2 \cdot 3} $$ $$\frac {(n+1)(n+2)(n+3).....(n+j)}{2 \cdot 3 \, ...... \cdot j}$$

and so on. It is not difficult to show that the numerator and the denominator in this sequence have the same divisibility by $2$ (i.e. their ratio is $\mod 2 = 1$) until in the numerator we reach the $n + 2^{i-1}= 2^i$ term and in the denominator the $2^{i-1}$ term. From this point, the numerator contains the factor $2$ one more time than the denominator, and we have that the ratio is $\mod 2 = 0$. This continues until in the numerator we reach the $n + 2^{i}=2^{i-1}+2^{i}$ term and in the denominator the $2^{i}$ term, where the denominator gets one factor $2$ more than the numerator and we get again that the ratio is $\mod 2=1$, and so on. Such regularity leads to the pattern described above, identical to that of the $i^{th}$ digit from the right in the binary numbers.