cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A054351 Successive generations of the Kolakoski sequence A000002.

Original entry on oeis.org

1, 12, 1221, 1221121, 12211212212, 122112122122112112, 1221121221221121122121121221, 1221121221221121122121121221121121221221121, 12211212212211211221211212211211212212211212212112112212211212212
Offset: 0

Views

Author

N. J. A. Sloane, May 07 2000

Keywords

Crossrefs

Word lengths give A054352.

Programs

  • Python
    from itertools import accumulate, groupby, repeat
    def K(n, _):
      c, s = "12", ""
      for i, k in enumerate(str(n)): s += c[i%2]*int(k)
      return int(s + c[(i+1)%2])
    def aupton(nn): return list(accumulate(repeat(1, nn+1), K))
    print(aupton(8)) # Michael S. Branicky, Jan 12 2021

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 05 2003