The Sierpiński Triangle and Pascal's triangle.

If you learned much maths at school you may recall the Binomial Theorem.This tells you how to expand a formula of the form (x+y)n. For example:

(x+y)0 =                        1
(x+y)1 =                  1*x + 1*y
(x+y)2 =            1*x2 + 2*xy + 1*y2
(x+y)3 =      1*x3 + 3*x2y + 3*xy2 + 1*y3
(x+y)4 = 1*x4 + 4*x3y + 6*x2y2 + 4*xy3 + 1*y4

Notice how the sum of the powers of x & y in each term is the same - it equals the power we are calculating. The numbers that appear in this expansion are called binomial coefficients.There is a simple mathematical formula for calculating them. The coefficient of xpyn-p is n!/p!(n−p)!. (n!, called n factorial, is n*(n-1)*(n-2)...1). n!/p!(n−p)! is always a whole number, and it is also the number of ways of choosing p objects from n (ignoring the order of selection), so these numbers are important in probability theory.

Although I just wrote that the formula for these numbers is simple, it is not especially convenient for calculation, even in these days of powerful computers, because factorials quickly get very large, and you have to do a lot of multiplications and divisions. There is another very easy way to calculate the numbers, which I have attempted to indicate from the way I arranged the first few powers of (x+y) above. It turns out that if 1 ≤p < n then the coefficient of xpyn-p is the sum of the coeffecients of xpyn-p-1 and xp-1yn-p (the coefficients at the two "ends" are always 1). This means that if you can find the coefficients by a simple process of repeated addition:

            1
          1   1
        1   2   1
      1   3   3   1
    1   4   6   4   1
  1   5  10  10   5   1
1   6  15  20  15   6   1

This pattern is called Pascal's triangle after the French mathematician Blaise Pascal, (he was also a scientist and theologian and the inventor of the barometer).

Mathematicians have been interested in the pattern of numbers within this triangle, and specifically the divisibility of the numbers in it. For example on rows that correspond to prime numbers all the numbers apart from the 1s at the end are divisible by the row number, but on other rows this is not the case.

It is also interesting to color the numbers according to their divisibility by a particular number, and especially the number 2. If you do this you get interesting patterns, and in fact for 2 you get a pattern that is more or less identical to the Sierpiński triangle!. For other prime numbers,p you get a similar pattern, but one where a triangle of triangles all the same size is removed at once. For composite numbers the pattern is rather more complicated, but you can usually see the patterns created by the various prime factors.

Pattern created by non zero remainders on division by 2 (i.e. odd numbers) in Pascal's Triangle. All these patterns were created using the Cellular automata option of Spirofractal and using the edit option to select suitable parameters. Spirofractal does not actually calculate numbers in the Pascal triangle: only the remainders after the division are important, and Spirofractal uses arithmetic modulo n=2,3,4,5,6 in these pictures. This is sometimes called clock arithmetic (because after a clock gets to 12 it goes back to 1 again). The twenty four hour clock is a better example, as clock arithmetic uses numbers from 0 to n-1 in the same way as the twenty four hour clock uses hours from 0 to 23.

Pattern created by non zero remainders on division by 3 in Pascal's Triangle. The patterns are fractals, or would be if you zoomed out infinitely and showed an infinite number of rows. Notice how the holes occur in groups of 3 )triangles of the same size, and grow larger and larger by a factor of 3. Groups of 3 arise because 3 is the 2nd "triangular" number, not because we are dividing by 3 - in the next pattern but one you will see holes occuring in groups of 10, as 10 is the fourth triangular number.

Pattern created by non zero remainders on division by 4 in Pascal's Triangle. The blue areas correspond to the parts where there are no odd numbers in the triangle so that the remainder is either two or zero. A similar effect would occur for other prime powers such as 8 or 9.

Pattern created by non zero remainders on division by 5 in Pascal's Triangle. Unfortunately the screen is too small to show enough iterations to get a really good idea of this pattern.

Pattern created by non zero remainders on division by 6 in Pascal's Triangle. Compare the patterns for 2 and 3. In the predominantly purple areas the remainder is 3 or 0, corresponding to the black areas in the pattern for 3. In the predominantly red and cyan areas the remainder is 2 or 4, corresponding to the black areas in the pattern for 2.

Click here to resume the fractal gallery tour, or here to start it.