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.
%I A025142 #23 Aug 10 2019 23:46:59 %S A025142 1,1,2,1,1,2,2,1,2,2,1,2,1,1,2,2,1,2,2,1,1,2,1,2,2,1,2,1,1,2,1,1,2,2, %T A025142 1,2,1,1,2,1,2,2,1,1,2,1,1,2,1,2,2,1,2,1,1,2,2,1,2,2,1,1,2,1,1,2,1,2, %U A025142 2,1,2,2,1,1,2,1,2,2,1,2,1,1,2,1,1,2,2,1,2,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,1,2,2,1,2,1 %N A025142 Fixed point of the square runlength transform, with a(1) = 1 (the runlength transform of a binary sequence is the sequence of the lengths of its runs). %C A025142 Unique sequence a such that a(1) = 1 and RL^2(a) = a != RL(a), where for any sequence s of 1's and 2's, the runlength transform of s RL(s) is such that RL(s)(n) = length of n-th run of same symbols in s; RL(a) is sequence A025143. %C A025142 Conjecture: as for the Kolakoski sequence A000002, which is a fixed point of RL, it remains to be shown that the limiting frequency of 1's and 2's in this sequence is 0.5. - _Jean-Christophe Hervé_, Oct 21 2014 %C A025142 Like the Kolakoski sequence, this sequence is cubefree and for this reason some words can never appear like XYXYX. Also, the number of 1's and 2's in any word of length 10 is 4, 5 or 6 (see comments in A000002). - _Jean-Christophe Hervé_, Oct 21 2014 %D A025142 Mathematische Semesterberichte 44 94 1997. %H A025142 Jean-Christophe Hervé, <a href="/A025142/b025142.txt">Table of n, a(n) for n = 1..10000</a> %H A025142 Sean A. Irvine, <a href="https://github.com/archmageirvine/joeis/blob/master/src/irvine/oeis/a025/A025142.java">Java program</a> (github) %F A025142 a(n) = run lengths of A025143, and A025143 = run lengths of a(n): this sequence and A025143 form a unique pair of distinct sequences with this property. - _Jean-Christophe Hervé_, Oct 21 2014 %e A025142 We illustrate how this sequence and A025143 can be constructed from each other. Start with two 1's in this sequence: a(1) = a(2) = 1 (and thus a(3) = 2), which gives A025143(1) = 2 (first run length of this sequence), followed by a 1 because a(1) = 1 is also the first run length of A025143; thus a(4) = 1, which gives A025143(3) = 2, which in turn gives a(5) = 1 and a(6) = 2, etc. - _Jean-Christophe Hervé_, Oct 21 2014 %o A025142 (R) seq <- function(n) { %o A025142 k2<- k1 <- rep(0,n+2) %o A025142 c1<-w2<- 1 %o A025142 w1<-c2<-k1[1]<-2 %o A025142 while(w2<=n){ %o A025142 while(c1<w1) { %o A025142 x<-(c1-1)%%2+1 %o A025142 k2[w2]<-x %o A025142 w2<-w2+1 %o A025142 if(k1[c1]==2) { %o A025142 k2[w2]<-x %o A025142 w2<-w2+1} %o A025142 c1<-c1+1} %o A025142 while(c2<w2 && w1<=n) { %o A025142 x<-c2%%2+1 %o A025142 k1[w1]<-x %o A025142 w1<-w1+1 %o A025142 if(k2[c2]==2) { %o A025142 k1[w1]<-x %o A025142 w1<-w1+1} %o A025142 c2<-c2+1}} %o A025142 return(cbind(1:n,k2[1:n]))} _Jean-Christophe Hervé_, Oct 21 2014 %Y A025142 A000002, A025143. %K A025142 nonn %O A025142 1,3 %A A025142 _Clark Kimberling_ %E A025142 Definition rewritten by _Jean-Christophe Hervé_, Oct 21 2014