Pascal Colors

A web project by Tim Black

What does it do?

The pictures that you can create with Pascal Colors are all based on Pascal's triangle, which is the following pyramid of numbers:

1
11
121
1331
14641
15101051
1615201561

Here's how it's constructed: Put a 1 in the top square of the pyramid. Fill in each successive row by writing on each square the sum of the two numbers directly above it (or if the it's on the edge of the pyramid, just use the one number above it - so that the pyramid has one's going down the outside). You can go on for as many rows as you'd like. There are a lot of interesting patterns in this pyramid; here's one:

Pick a number to be the "base"; say, 3. Pick a square of Pascal's triangle and divide the number by 3; we'll only care about the remainder. If you get a remainder of 1, color that square red. If you get a remainder of 2, color it orange. And if you get a remainder of 0, color it white. Here's what you get if you do this for the first seven rows:

1
11
121
1331
14641
15101051
1615201561

Pascal Color lets you choose a base, and see what happens if you color in Pascal's triangle according to the rules above. The "zoom" function let's you pick how many rows of Pascal's triangle to show, according to the rule:

number of rows = basezoom.

The rule for zooming was chosen like this because you can often see patterns appear if you increase by one level of zoom at a time.

Keyboard shortcuts

B: puts the cursor in the "base" box and resets the "zoom" box to 1.
Z: puts the cursor in the "zoom" box.
Up arrow: increases the zoom by 1.
Down arrow: decreases the zoom by 1.
Right arrow: adds one row to the triangle.
Left arrow: removes one row from the triangle.

Downloading pictures

If you create a picture you like, you can right-click to download (just like a normal image). I'd appreciate attribution though (actually, I put attribution at the bottom of the image - I hope it is not too obtrusive!).

A word of warning

The number of rows displayed goes up exponentially with the level of zoom, so if you try to zoom too much, it's very easy to make the webpage crash accidentally.

last updated 2.14.2013
Tim's homepage