The 51-Star Flag

Originally ran in Slate on June 9, 2010. By Chris Wilson.

How would the flag be rearranged if the United States added another state? It's not an entirely moot question. In the spring of 2010, Congress considered a bill that could lead to Puerto Rico's inclusion as the 51st state.

To take this question to the absurd extreme, we made a Flash widget that can compute the symmetrical pattern for any number of stars on the flag up to 100, with a few tricky exceptions for 29, 69, and 87 stars, for which none of our six patterns found a match.

With the help of mathematician Skip Garibaldi, we wrote algorithms for all the possible patterns: alternating rows of even and odd stars, rectanglar matrices, etc. For each number of stars entered, an Actionscript function checks which of the six patterns can produce that number.

Help with this project! There are still patterns we haven't solved yet. If you want to pitch in, check out the notes below.

How you can help: Many Slate readers sent in creative ideas for how to arrange flags with 29, 69, and 87 stars, all of which flunked our algorithms. For example, reader Rob Jones designed these three:

29 stars 69 stars 87 stars

The trick is to write an algorithm for the pattern that can test against N stars. If you think you're up to the task, email Slate Labs and we'll send you some examples of the algorithms.