What you've got there is a truth table for the XOR bitwise operation.
HV | O
---+---
11 | 0
00 | 0
10 | 1
01 | 1
You can do it very similarly with the coordinates of the pixels on the screen[1]. It's really interesting how often that shape comes out of places. Which is why I think that this page got started.[1] http://www.stilldreamer.com/mathematics/sierpinskis_triangle...