A079729 Kolakoski-(1,2,3) sequence: a(n) is the length of the n-th run.
1, 2, 2, 3, 3, 1, 1, 1, 2, 2, 2, 3, 1, 2, 3, 3, 1, 1, 2, 2, 3, 3, 3, 1, 2, 2, 3, 3, 3, 1, 1, 1, 2, 3, 1, 1, 2, 2, 3, 3, 3, 1, 1, 1, 2, 2, 2, 3, 1, 1, 2, 2, 3, 3, 3, 1, 1, 1, 2, 2, 2, 3, 1, 2, 3, 3, 1, 1, 1, 2, 3, 1, 1, 2, 2, 3, 3, 3, 1, 1, 1, 2, 2, 2, 3, 1, 2, 3, 3, 1, 1, 2, 2, 3, 3, 3, 1, 2, 3, 3, 1, 1, 2, 2, 2
Offset: 1
Keywords
Examples
Sequence begins: 1,2,2,3,3,1,1,1,2,2,2,3,1,2,3,3,1,1,... read it as: (1),(2,2),(3,3),(1,1,1),(2,2,2),(3),(1),(2),(3,3),(1,1),... then count the terms in parentheses to get: 1,2,2,3,3,1,1,1,2,2,... which is the same sequence.
Links
- Ivan Neretin, Table of n, a(n) for n = 1..10000
- Kerry Mitchell, Creating Unicursal Curves Using Tiles, Bridges Conf. Proc. (2025) 239-246.
- Ulrich Reitebuch, Henriette-Sophie Lipschütz, and Konrad Polthier, Visualizing the Kolakoski Sequence, Bridges Conf. Proc.; Math., Art, Music, Architecture, Culture (2023) 481-484.
Crossrefs
Cf. A000002.
Programs
-
Mathematica
seed = {1, 2, 3}; w = {}; i = 1; Do[w = Join[w, Array[seed[[Mod[i - 1, Length[seed]] + 1]] &, If[i > Length[w], seed, w][[i]]]]; i++, {n, 53}]; w (* Ivan Neretin, Apr 02 2015 *)
-
PARI
a=[1,2,2];for(n=3,100,for(i=1,a[n],a=concat(a,1+((n-1)%3))));a; \\ Benoit Cloitre, Feb 13 2009
Formula
Iterate beta: 122 -> 12233 ~ 122331 -> 122331112223 -> 12233111222312331122333, etc. Here a(6)=1 has been added to 12233 in step two to continue the iteration. - Michel Dekking, Jan 31 2018
Extensions
More terms from Philippe Deléham, Sep 24 2006
Name changed and text edited by Michel Dekking, Jan 31 2018
Comments