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.

A079729 Kolakoski-(1,2,3) sequence: a(n) is the length of the n-th run.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Feb 17 2003

Keywords

Comments

Old name was: Kolakoski variation using (1,2,3) starting with 1,2.
Partial sum sequence is expected to be asymptotic to 2*n.
From Michel Dekking, Jan 31 2018: (Start)
(a(n)) is the unique fixed point of the 3-block substitution beta given by
111 -> 123, 112 -> 1233,
122 -> 12233, 123 -> 122333,
222 -> 112233, 223 -> 1122333,
231 -> 112223, 233 -> 11222333,
311 -> 11123, 312 -> 111233,
331 -> 1112223, 333 -> 111222333.
Here BL3 := {111, 112, 122, 123, 222, 223, 231, 233, 311, 312, 331, 333} is the set of all words of length 3 occurring at a position 1 mod 3 in (a(n)). This can be seen by splitting the words beta(B) into words of length 3, and looking at the possible extensions of those words beta(B) that have a length which is not a multiple of 3. For example, beta(122) = 12233 can only be extended to 122331 or to 122333, and both words 331 and 333 are in BL3. Interestingly, BL3 is invariant for the permutation 1->3, 2->1, 3->2 (and its square).
Note: In general, a 3-block substitution beta maps a word w(1)...w(3n) to the word
beta(w(1)w(2)w(3))...beta(w(3n-2)w(3n-1)w(3n)).
If the length of a word w is 3n+r, with r=1 or r=2, then the last letter, respectively last 2 letters are ignored. (End)
Conjecture: the frequencies of 1's, 2's and 3's in (a(n)) exist and are all equal to 1/3. This conjecture implies the conjecture of Benoit Cloitre on the partial sum sequence. - Michel Dekking, Jan 31 2018

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.
		

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