The new Matt Parker puzzle asks, How odd is Pascal’s triangle? Or more specifically, what percentage of the entries in the first 128 rows are odd?

Since we don’t care about the numbers themselves, just how odd they are, we can consider a modified triangle where the rule is: Each entry is the XOR (exclusive or) of the two above it. Using ones and zeroes, this triangle looks like:

Row 1 | 1 | ||||||||||||||

2 | 1 | 1 | |||||||||||||

3 | 1 | 0 | 1 | ||||||||||||

4 | 1 | 1 | 1 | 1 | |||||||||||

5 | 1 | 0 | 0 | 0 | 1 | ||||||||||

6 | 1 | 1 | 0 | 0 | 1 | 1 | |||||||||

7 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | ||||||||

8 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |

An entry in this triangle is 1 if and only if the corresponding entry in Pascal’s triangle is odd. If you examine this and carry it forward, you realize this is starting to look like another famous mathematical triangle, the Sierpiński triangle. As you go to more and more rows, it gets closer to the Sierpiński triangle’s fractal nature.

In fact, what you notice is that at every row that’s a power of 2 (row 1, 2, 4, 8, 16, 32…) every entry in the row is 1. And at that point the uppermost half of the triangle is replicated twice in the lowermost half, with an “empty” triangle (all zeros) in between. For instance:

1 | 1 | ||||||||||||||

2 | 1 | 1 | |||||||||||||

3 | 1 | 0 | 1 | ||||||||||||

4 | 1 | 1 | 1 | 1 | |||||||||||

5 | 1 | 0 | 0 | 0 | 1 | ||||||||||

6 | 1 | 1 | 0 | 0 | 1 | 1 | |||||||||

7 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | ||||||||

8 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |

Rows 1–2 have a triangle of size 2, composed of three 1s; rows 3-4 are two such triangles, with a “triangle” of size 1, composed of a single 0, in between. And then:

1 | 1 | ||||||||||||||

2 | 1 | 1 | |||||||||||||

3 | 1 | 0 | 1 | ||||||||||||

4 | 1 | 1 | 1 | 1 | |||||||||||

5 | 1 | 0 | 0 | 0 | 1 | ||||||||||

6 | 1 | 1 | 0 | 0 | 1 | 1 | |||||||||

7 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | ||||||||

8 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |

Rows 1–4 have a triangle of size 4, composed of nine 1s and a 0; rows 3-4 are two such triangles, with a triangle of size 3, composed of six 0s, in between. And so on.

More generally, when you reach row , the first rows contain a triangle of size and the last rows contain two such triangles with an “empty” triangle of size in between.

But that just means the number of 1s in the first rows is 3 times the number in the first rows. There’s one 1 in the first 1 rows, 3 in the first 2 rows, 9 in the first 4 rows, and so on: in the first rows. The total number of entries in rows is , and the percentage of odd entries is just the ratio of these two: :

2^n | 3^n | T(2^n) | P(n) |

2 | 3 | 3 | 100% |

4 | 9 | 10 | 90% |

8 | 27 | 36 | 75% |

16 | 81 | 136 | 59.56% |

32 | 243 | 528 | 46.02% |

64 | 729 | 2080 | 35.05% |

128 | 2187 | 8256 | 26.49% |

As you go to more and more rows, the percentage of odd entries gets smaller. For large , the first rows contain a triangle of zeros filling up the middle one quarter (slightly less) of the triangle, and each of the other three quarters is a triangle containing a triangle of zeros filling up the middle one quarter, with the other three quarters being a triangle containing a triangle of zeros… well, turtles all the way down. As approaches infinity, approaches equality with . But the big triangle is a quarter empty and three quarters nonempty, so , so in the limit, .

Or, using the formula, .

If the above triangle reminds you of a 1-dimensional cellular automaton, by the way, that’s because it is one. Specifically, you can think of it as a skewed version of Rule 60 or Rule 102 (with successive rows shifted half a cell left or right, respectively), or, if you regard adjacent numbers as actually having zeros between them, it’s Rule 90. These are the three rules in which the next state of a cell is the XOR of two of the three cells in its neighborhood.