Main










Applications


Identities







History


FAQ


Algorithms




Generalized Sierpinski's Gasket in Color

This is a Java applet which shows the entries of the first 240 rows of Pascal's Triangle as small dots of a color based on the remainder upon division by n, a number between 2 and 22. To change n, use the slider at the top of the screen; n is initialized as 2, and the only color turned on is 1; the pattern made by 1 (mod 2) is known as Sierpinski's Gasket or Sierpinski's Triangle; choosing different n and turning on different colors gives you different patterns; when a number k is chosen, the phrase k (mod n) is written on the screen in the color that will be used for the dots corresponding to that number.
 
Changing colors: In math, k (mod n) means the set of all numbers that can be written as k + rn, where r is any integer. For example, 8 and 15 are both elements of 1 (mod 7). If you want a different color to be used in a pattern, turn off the lower values in that set and turn on a higher value; when you do this, an asterisk * will appear after the phrase. In the example of mod 7, you can get the mod 1 color (red) to change to the mod 8 color (light gray) by turning off 1 and turning on 8; likewise, you can see the color for 15 (cyan) by turning on 15 and off 8 and 1.

Educational value:  While there are some identities in Category 5 that can be proven by inspecting the Generalized Sierpinski's Gasket (mod p) where p is a prime, the main use of this applet is to look at the pretty colors.

One of the identities in Category 5 is Lucas Theorem, which will tell us whether a particular binomial coefficient is even or odd, and can be used to tell how many entries in any given row of Pascal's Triangle are even or odd.  The idea is to check the binary representations of the upper and lower indices, n and k respectively, and if k has a 1 in a place where n has a 0, the binomial coefficient will be even, and otherwise it will be odd.


The applet looks best when run in full screen mode.  If the box below is just a grey rectangle, you can put Java on your machine for free through this link







Some pretty patterns:

RGB specials:  Choose mod 7, turn on 1, 2, 3, 11, 12, 13.  You can also try turning on 0 (grey background) or turn off 0 and turn on 7 (yellow background).  These colors are also interesting at mod 17 and mod 19.

Patterns in grey: Colors 8, 10, 18, 20 and 21 are all shades of grey; so is color 0, but it tends to add too much; some of the patterns using these colors are very nice.  I especially like mod 11 and mod 13, and I like mod 8 and mod 16 when color 8 is turned off.

Hot colors: Colors 1, 4, 7, 9, 11, 14, 17 and 19 give you patterns in red, yellow, orange and pink.  Take a look at these colors turned on in mod 5, mod 6, mod 10, mod11, mod 13, mod 21 and 22.

Try your own ideas as well.