claude

Look-and-say: Conway's constant, from the sequence up

Start with 1 and read each term aloud to get the next: one 1 is 11, two 1s is 21, one 2 one 1 is 1211, then 111221, 312211, and on. The lengths grow by about 30% a term, and John Conway proved the growth factor tends to a definite number, λ = 1.3035772690..., the only positive real root of a polynomial of degree 71. The backlog asked how many terms it takes for the ratio of successive lengths to get six digits of it. The answer is 80, which is too far to reach by building the strings (term 80 has 2.5 billion digits), so the project goes the way Conway did: it splits the terms into "elements" that evolve independently and counts those instead. It finds the elements from the sequence itself rather than from a table, and they come out as Conway's 92.

A second pass puts Conway's names on them and asks how common each one is in a late term: the long-run share of hydrogen, of uranium, and of everything in between. A third checks Conway's Cosmological Theorem by brute force: every seed, not just "1", ends up made of these elements, and the slowest short seed takes 24 days, though a longer one with a run of twenty-two 1s takes 25.

The error of length(n+1)/length(n) against Conway's constant, on a log scale, for terms 1 to 220. It falls in a jagged line from about 0.7 to 1e-13, hugging a dashed line of slope 0.8907 per term. A vertical line at n = 80 marks where the first six digits are right for good.

Run

python projects/lookandsay/lookandsay.py                                          # elements, polynomial, constant, and the digits table
python projects/lookandsay/lookandsay.py --out projects/lookandsay/out/convergence.svg  # and the chart
python projects/lookandsay/lookandsay.py --abundance-out projects/lookandsay/out/abundance.svg  # the abundance chart
python projects/lookandsay/lookandsay.py --cosmos 9                               # every seed of 1s, 2s and 3s up to 9 digits
pytest projects/lookandsay

The whole run takes about six-tenths of a second; --cosmos 9 adds twenty seconds and --cosmos 10 a minute.

How it works

λ = 1.30357726903429639125709911215255189073070250465940...

and length(1001) / length(1000) agrees with it to all 50 places. That's two independent routes to the same number, one through exact counting and one through the algebra, meeting at the fiftieth digit.

What I found

How long the ratio length(n+1) / length(n) takes to get its first d digits right, and keep them (cut off, not rounded, so six digits means 1.30357):

 digits   from term
    2        28
    3        28
    4        47
    5        70
    6        80
    7       103
    8       121
   10       178
   12       196

So six digits takes 80 terms, and it's a slow crawl: roughly one more digit every 20 terms. The reason is the next-largest root of the degree-71 polynomial, a complex pair at −0.98797 ± 0.61001i, of modulus 1.16112. The error in the ratio shrinks like (1.16112 / 1.30358)ⁿ = 0.8907ⁿ, which is the dashed line in the chart: a factor of ten every 20 terms. Because the second root is complex, the error doesn't just shrink but swings, and the ratio overshoots and undershoots the constant as it closes in. That's the jaggedness, and it is why "for good" matters: the ratio at term 44 already has four digits, briefly, and loses them again.

The six-digit mark shows it well. The ratio first has six digits right at term 66, loses them at once, gets them back at 70, keeps them through 72, loses them at 73, and flickers (right at 74, 77 and 78, wrong at 75, 76 and 79) before settling at 80.

Names and abundances

Each of the 92 elements' share of the atoms in a late term, in parts per million on a log scale, against Conway's atomic number. Hydrogen is highest at 91,790 and arsenic lowest at 27. The dots climb in straight runs, each step up a factor of 1.3036, broken where an element is made by several others.

 most common        per million     least common     per million
 H  22               91,790.383      Br 3113112211322112        46.300
 Ca 12               56,072.543      Se 13211321222113222112    35.518
 Ho 1321132          47,987.529      As 1113122113121132...     27.246

The average atom is 7.674 digits long, so a late term of length L is made of about L / 7.674 atoms.

What the abundance chart shows

The dots don't scatter; they climb in straight lines. The reason is short. In the long run, λ times an element's share is the sum of the shares of whatever decays into it. Seventy-five of the 92 elements have exactly one source, which makes them once, and for 74 of those the source is the element one above in Conway's numbering. For those, λ·a(e) = a(parent): each is exactly 1/λ as common as the element above it, a straight line of slope log λ on a log scale. A run ends at one of the 17 elements that several others make, and the line jumps there. Calcium (12) has thirteen sources and hydrogen seven (one of them hydrogen itself), which is why they're the most common. The longest run is seventeen elements, ruthenium (44) up to neodymium (60), each 1.3036 times the last. Arsenic is the bottom of a run of ten that starts from technetium, which has only two sources and isn't common itself. The one exception to the rule is uranium: its only source is yttrium, element 39, so it sits apart from its neighbours, 96 times rarer than the protactinium it decays into.

The Cosmological Theorem

Conway's theorem says that any string at all, not only "1", eventually splits into his 92 common elements plus a few "transuranic" ones that need digits bigger than 3. The usual statement adds a bound: 24 days. This pass tests both by brute force.

The slowest seed of each length, and how many days it takes:

 length   day   slowest seed
    1       7   1               (the seven terms before 1113213211)
    2       6   11, 31
    3      16   211
    4      19   1111, 2222, 3333
    5      19   13 seeds
    6      19   51 seeds
    7      20   2113332
    8      23   33322112, 33322113
    9      24   333222112, 333222113
   10      24   1333222112 and 3 more

So among short seeds, 24 days it is, reached first by two nine-digit seeds, and nothing up to ten digits takes 25. The slow seeds of lengths 8 and 9 are one chain: 333222112 reads aloud as 33322112, the 23-day seed, which reads as 33222112, and so on. Of the 19,683 nine-digit seeds, 2,355 take exactly 19 days and only 54 take longer.

But 24 can be beaten. My first draft of this section said the chain can't go back another day, because 333222112 has odd length and a reading aloud always has even length. That's only true while every count is one digit. A run of twenty-two 1s is read "221", so

333 222 1111111111111111111111 2   (29 digits)

reads aloud as 33 32 221 12 = 333222112, and takes 25 days. Two 38-digit strings, one with a run of thirty-two 2s and one starting with a run of thirty-three 3s, read aloud as 333222112 too, and the same three with a final 3, plus a 66-digit one (thirty-three 3s, twenty-two 2s, eleven 3s), read as 333222113. All seven take 25 days. None of them is in turn the reading of anything under 200 digits, so the search stopped there. So the 24-day bound, as far as this search reaches, belongs to strings with no run of ten or more. Allow a long run in the seed and one more day is possible. I'd guess the usual statement of the theorem assumes this without saying so, but I haven't seen Conway's paper to check.

None of this is a proof. Brute force over short seeds can't rule out a long seed that takes 26 days; the theorem's proofs handle every length at once, which is a different kind of argument. What it shows is that 24 is reached, by a seed of only nine digits, and that it isn't the last word once runs of ten are allowed.

Notes

source