Lab · Combinatorics
Pascal's triangle, coloured by p
Colour each binomial coefficient by the power of a prime that divides it, and Pascal's triangle turns into a fractal. Kummer's theorem explains the picture: the exponent is the number of carries in a base-p addition.
Write $v_p(m)$ for the exponent of the prime $p$ in $m$. In 1852 Kummer found a surprising rule for binomial coefficients: $v_p\binom{n}{k}$ is the number of carries when $k$ and $n - k$ are added in base $p$. No carries means $p \nmid \binom{n}{k}$, and those are the marigold cells. A companion result of Lucas (1878) gives the residue: if $n = \sum n_i p^i$ and $k = \sum k_i p^i$ in base $p$, then $$\binom{n}{k} \equiv \prod_i \binom{n_i}{k_i} \pmod p.$$ Hover over any cell to see the addition $k + (n-k) = n$ written out, with the carries marked.
Why it is a fractal
Lucas's theorem says the residue of $\binom{n}{k}$ depends on the base-$p$ digits one at a time. Rows $0$ to $p^{m} - 1$ therefore contain a small triangle (the last digit) repeated in the pattern of a big triangle (the leading digits), and the whole picture is self-similar with ratio $p$. For $p = 2$ the cells not divisible by $2$ form the Sierpiński triangle; the gallery has a proof without words of the doubling step.
Two consequences are easy to read off. Row $n$ contains exactly $\prod_i (n_i + 1)$ entries not divisible by $p$, because each digit $k_i$ can be chosen from $0, \dots, n_i$ without causing a carry; for $p = 2$ that is $2^{s(n)}$ with $s(n)$ the number of $1$s in binary. And the rows $p^m - 1$ (all digits $p - 1$) are entirely marigold, while the rows $p^m$ are divisible by $p$ everywhere except at the two ends.
Full proof: Kummer's theorem from Legendre's formula
Legendre's formula. $v_p(n!) = \dfrac{n - s_p(n)}{p - 1}$, where $s_p(n)$ is the sum of the base-$p$ digits of $n$.
Proof. $v_p(n!) = \sum_{j \ge 1} \lfloor n/p^j \rfloor$, since $\lfloor n/p^j \rfloor$ counts the multiples of $p^j$ up to $n$. If $n = \sum_i n_i p^i$ then $\lfloor n/p^j \rfloor = \sum_{i \ge j} n_i p^{i-j}$, and summing over $j$ gives $\sum_i n_i (p^{i-1} + \dots + 1) = \sum_i n_i \frac{p^i - 1}{p - 1} = \frac{n - s_p(n)}{p - 1}$. $\square$
Kummer's theorem. $v_p\binom{n}{k}$ equals the number of carries when adding $k$ and $n - k$ in base $p$.
Proof. By Legendre's formula, $$v_p\binom{n}{k} = v_p(n!) - v_p(k!) - v_p((n-k)!) = \frac{s_p(k) + s_p(n-k) - s_p(n)}{p - 1}.$$ Add $a = k$ and $b = n - k$ digit by digit. In position $i$ we have $a_i + b_i + c_i = n_i + p\,c_{i+1}$, where $c_i \in \{0, 1\}$ is the incoming carry and $c_0 = 0$. Summing over $i$, $s_p(a) + s_p(b) + \sum_i c_i = s_p(n) + p\sum_i c_{i+1}$, so $s_p(a) + s_p(b) - s_p(n) = (p - 1)\cdot(\text{number of carries})$. $\square$
Further reading
- A. Granville, Arithmetic properties of binomial coefficients I: Binomial coefficients modulo prime powers, Canadian Mathematical Society Conference Proceedings 20 (1997).
- E. Kummer, Über die Ergänzungssätze zu den allgemeinen Reciprocitätsgesetzen, Journal für die reine und angewandte Mathematik 44 (1852).
- N. J. Fine, Binomial coefficients modulo a prime, American Mathematical Monthly 54 (1947).