An interesting nonmathematical sequence which yet has interesting mathematical properties is the Look-and-say sequence.

As every good sequence it starts with a 1. From there you get each next entry by looking at the previous and saying it. The next entry will thus be “one 1” or 11. From there “two 1” or 21, then “one 2; one 1” or 1211, “one 1; one 2; two 1” or 111221 and so on.

#### Generating the sequence

The mathematical property although does not lie in the entry’s value, but rather in its length.

#### Calculating the length of each entry

The interesting thing about the length is, that it approximately grows by λ each time.

This constant λ can be calculated by getting the real root of a degree 71 polynomial (see Nathaniel Johnston’s post for further information) or be approximated by dividing entrys.

#### Approximating λ

```
# Python 2.7.7 Code
# Jonathan Frech 25th of February, 2016
# edited 26th of February, 2016
# edited 28th of February, 2016
# edited 4th of March , 2016
```

```
# set the program's mode
MODE = ["sequence", "length", "lambda"][2]
# advance the sequence
def advance(seq):
# special case
if seq == "":
return "1"
# result
res = ""
# init
c = seq[0]
a = 1
seq = seq[1:len(seq)]
# loop (look at the sequence and 'say' it)
for s in seq:
if s == c:
a += 1
else:
res += str(a) + c
c = s
a = 1
# return
return res + str(a) + c
# generate the sequence
if MODE == "sequence":
seq = ""
while True:
seq = advance(seq)
print seq
# generate the sequence and get each entry's length
elif MODE == "length":
seq = ""
while True:
seq = advance(seq)
print len(seq)
# approximate lambda
elif MODE == "lambda":
seq = ""
while True:
nseq = advance(seq)
if len(seq) > 0:
print "lambda approx. " + str(1. * len(nseq) / len(seq))
seq = nseq
```