just a bear whose intentions are good (two_star) wrote,

look, say, walk

1, 11, 21, 1211, 111221, 312211...

Those are the first few numbers in the look-and-say sequence, so called because it is formed by looking at the previous number in the sequence and describing it by the lengths of runs of digits. (Thanks to yhlee for bringing this sequence up.)

John Conway did some interesting work on this sequence, characterizing 92 "elements" or substrings that appear in look-and-say numbers, which have descendant strings that never interact with the descendant strings of neighboring elements.

As you might imagine, the numbers in the sequence exhibit fractal-like characteristics, since multiple instances of the same element appearing early in the sequence will result in longer repeated sequences in later look-and-say numbers.

Unfortunately, this sort of structure in a 1-d string is not particularly visually satisfying — but what if we could translate look-and-say numbers into two dimensions? It occurred to me that we could use the fact that only the digits 1, 2, and 3 appear in look-and-say numbers to generate walks in a square grid from them. We would pick one of these digits to map to "go forward one step" and the others to map to "turn left, then step forward" and "turn right, then step forward."

For the image below, I chose 3 as the "go straight" digit. I got something of a tangled mess using 1, and 2 gave me big blobs where the path wandered around in the same area for a long time. This is the 37th look-and-say number, as translated into a square grid walk:



The path looks somewhat random at first, but a second look reveals repeated patterns all over it. I like it.
Tags: look-and-say, math
  • Post a new comment

    Error

    default userpic
  • 5 comments