Playing with Pascal's Triangle

Back in the day I remember writing an algorithm on a Timex Sinclair that would use binary logic to generate a Pascal Triangle. I found this image on Google,

which exactly describes the logic my program of the day used. Would it were I could remember it, but I don’t recall it being a lot of if conditions. More toggles as memory serves.

What I would hope for now is some sort of replication of that kind of binary logic to construct this triangle.

The image traces back to a blog article,

Playing with Pascal’s Triangle

Anybody looking for a challenge?

1 Like

It looks like the classic Pascal’s triangle, mod 2. In other words, wherever there is an even number in the classic Pascal’s triangle, there is a 0 in this one. Wherever there is an odd number in the classic Pascal’s triangle, there is a 1 in this one.

It also appears that all the values in the internal cells in this triangle can be generated via an exclusive-OR operation on the two cells above it.

Nice fractal pattern!

See Wikipedia: Pascal’s triangle.

1 Like

The fractal is called a “Sierpinski triangle”. :slight_smile:


Yes, and as an alternative to growing this triangle from the top down, as with a Pascal’s triangle, we could grow it as a fractal, perhaps via a recursion.