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

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

  • I get to play with laser!

    TechShop Portland now has its Epilog Helix 45 Laser cutter, and I'm signed up to take a safety and basic usage class this Friday. Before Memorial…

  • Polyomino cover variations

    To recap, since it's been a while since I've done one of these, a polyomino cover (not real terminology, but mine) is a set of cells in a square…

  • Python code for look-and-say walk

    Here's the Python code I used to make the look-and-say walk.The svg.py that it uses is this recipe. import svg def looksay(l): out = [] last =…

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.