def las(s): out=[]; i=0; n=len(s) while icap: break return s, lens CONWAY=1.303577269034296 for seed in ["1","3","2","1112"]: s,lens=run(seed,55) ratios=[lens[i+1]/lens[i] for i in range(len(lens)-1)] tail=ratios[-3:] print("seed=%-5s steps=%2d final ratio=%.6f |lambda-r|=%.2e digits=%s"%( seed, len(lens)-1, ratios[-1], abs(ratios[-1]-CONWAY), ''.join(sorted(set(s))))) # the '22' exception: it is a fixed point (stays length 2 forever) s,lens=run("22",10) print("seed=22 (the known exception) lengths:", lens)