OFFSET
1,2
LINKS
Konstantinos Lambropoulos and Constantinos Simserides, Spectral, localization and charge transport properties of periodic, aperiodic and random binary sequences, arXiv:1808.04764 [cond-mat.soft], 2018.
Eric Weisstein's World of Mathematics, Kolakoski Sequence
FORMULA
Conjecture: a(n) is asymptotic to c*(3/2)^n where c=0.5819.... - Benoit Cloitre, Jun 01 2004
For n >= 1, a(n+3) = S^n(2) where S(n) = A054353(n) and S^k(2) = S(S^(k-1)(2)). - Benoit Cloitre, Feb 24 2009 [adjusted to match sequence offset by Jon Maiga, Jul 27 2022]
EXAMPLE
/* generate sequence of sequences by recursion using next1() ( origin 1 ) */
v=[2]; for(n=1,8,p1(v); print1(" -> "); v=next1(v))
2 -> 11 -> 12 -> 122 -> 12211 -> 1221121 -> 1221121221 -> 122112122122112 ->
v=[2]; for(n=1,8,print1(length(v)); print1(","); v=next1(v)) gives: 1,2,2,3,5,7,10,15,
PROG
(PARI) /* generate sequence starting at 1 given run length sequence */
next1(v)=local(w); w=[]; for(n=1, length(v), for(i=1, v[n], w=concat(w, 2-n%2))); w
/* print a number or sequence recursively with no commas */
p1(v)=if(type(v)!="t_VEC", print1(v), for(n=1, length(v), p1(v[n])))
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Corrected by and better description from Michael Somos, May 05 2000
STATUS
approved