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.

This page as a plain text file.
%I A054351 #9 Jan 12 2021 21:34:11
%S A054351 1,12,1221,1221121,12211212212,122112122122112112,
%T A054351 1221121221221121122121121221,
%U A054351 1221121221221121122121121221121121221221121,12211212212211211221211212211211212212211212212112112212211212212
%N A054351 Successive generations of the Kolakoski sequence A000002.
%o A054351 (Python)
%o A054351 from itertools import accumulate, groupby, repeat
%o A054351 def K(n, _):
%o A054351   c, s = "12", ""
%o A054351   for i, k in enumerate(str(n)): s += c[i%2]*int(k)
%o A054351   return int(s + c[(i+1)%2])
%o A054351 def aupton(nn): return list(accumulate(repeat(1, nn+1), K))
%o A054351 print(aupton(8)) # _Michael S. Branicky_, Jan 12 2021
%Y A054351 Cf. A054348, A054349, A054350, A054352, A042942, A000002.
%Y A054351 Word lengths give A054352.
%K A054351 nonn,easy
%O A054351 0,2
%A A054351 _N. J. A. Sloane_, May 07 2000
%E A054351 More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 05 2003