OFFSET
1,3
FORMULA
As for the Kolakoski sequence we suspect Sum_{k=1..n} a(k) = (3/2)*n + o(n).
Generated by infinitely iterating the morphism a->abc, b->dab, c->efg, d->hcd, e->cda, f->bef, g->ghc, h->dab starting with a, obtaining the infinite word abcdabefg..., and then replacing a,b,e,f by 1 and c,d,g,h by 2. Using Walnut, one can then prove the above claim about Sum_{k=1..n} a(k) in the stronger form Sum_{k=1..n} a(k) = (3/2)*n + O(1). Jeffrey Shallit, Dec 31 2024
EXAMPLE
The third run is 1,1,1,1, which is of length 4, thus a(3) = 4/2 = 2.
PROG
(PARI) w=[1, 1]; for(n=2, 1000, for(i=1, 2*w[n], w=concat(w, 1+(n+1)%2))); w \\ Corrected by Kevin Ryde and Jon Maiga, Jun 11 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Feb 23 2009
STATUS
approved