Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The function (x-y/2)&y = 0 can be used to plot a sierpinski triangle. For example:


Why does this happen?

share|cite|improve this question
See this link – Babak S. Nov 16 '13 at 15:20

The function computes the parity of the values in the Pascal Triangle. To prove that the output resembles a Sierpinski triangle (of course it's just a finite representation of this...) you may just show that the parity structure for rows $1$ to $2^k$ is repeated at the left and the right side for rows $2^k+1$ to $2^{k+1}$, and that the middle part always has even values. It's just some manipulation of $C(k,n)$ :-)

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.