C(n, k) = C(n−1, k−1) + C(n−1, k)In Pascal's triangle every number is the sum of the two above it, with 1s down both sides:
C(n, k) = C(n−1, k−1) + C(n−1, k)
The numbers grow fast. Row 127 starts 1, 127, 8,001, 333,375… So the video doesn't show the numbers, only their remainders.
Odd and even: 128 rows
First, remainder after ÷ 2: odd numbers are lit in blue, even numbers stay dark. The first 8 rows appear with their numbers, then the triangle zooms out to 128 rows. What's left is the Sierpinski triangle: three half-size copies of the whole, with an upside-down dark triangle in the middle, and each copy made of three smaller copies in the same way.
Of the 8,256 numbers in 128 rows, 2,187 are odd, and 2,187 = 3⁷. That's no accident: each doubling of the rows triples the lit cells, because the triangle is three copies of its top half.
÷ 3 and ÷ 5
The same rule, with remainders after ÷ 3 on 243 rows: remainder 1 in teal, 2 in violet. Now the triangle is six copies of its top third, and 7,776 = 6⁵ of its 29,646 numbers are lit. Then remainders after ÷ 5 on 125 rows, with 1 pink, 2 violet, 3 cyan and 4 green: 15 copies of its top fifth, and 3,375 = 15³ of 7,875 lit.
Only the remainders are needed: the remainder of a sum is the remainder of the sum of the remainders, so the video builds each triangle with the addition rule, working only with remainders. The row counts are powers of 2, 3 and 5, so each fractal ends on a whole copy. In each, the newest rows flash white as they're added.
Why copies?
For a prime p, Lucas's theorem says C(n, k) can be divided by p exactly when some digit of k, written in base p, is bigger than the matching digit of n. So row n has as many numbers that p doesn't divide as there are ways to pick each digit of k no bigger than n's. Adding up over the first pᵐ rows gives (1 + 2 + … + p)ᵐ: 3⁷, 6⁵ and 15³. The last row of each picture, row 127, 242 or 124, has all its digits equal to p − 1, so it's lit all the way across.
Part of Pascal's triangle mod n: Every number is the sum of the two above it. Colour each by its remainder, and fractals appear.
Use this picture
Free to reuse, also commercially, under CC BY 4.0. Credit “What Math Means” with a link to whatmathmeans.dev/v/pascals-triangle-draws-a-fractal.







