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.

A270226 a(n) is the number of terms in the n-th block of consecutive integers of A136119.

Original entry on oeis.org

1, 3, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3
Offset: 1

Views

Author

Benedict W. J. Irwin, Mar 13 2016

Keywords

Comments

Conjecture: Partial average of the sequence converges to 1+sqrt(2).
Proof of the conjecture: since A136119(n+1) - A136119(n) = A001030(n), the sequence (a(n+1)) is the fixed point of the substitution sigma: 2->32, 3->322. Here one uses that since sigma(a)=a, the length of the n-th block is coded by the n-th letter. Since the frequencies of 2 and 3 in this fixed point are respectively sqrt(2)/(1+sqrt(2)) and 1/(1+sqrt(2)), the conjecture follows. (Alternatively: (a(n+1)-2) is a Sturmian sequence with density sqrt(2)-1). - Michel Dekking, Jan 22 2017

Examples

			From A136119 consecutive blocks are
1          a(1)=1,
3, 4, 5    a(2)=3,
7, 8       a(3)=2,
10, 11     a(4)=2,
13, 14, 15 a(5)=3.
		

Crossrefs

Cf. A136119.

Programs

  • C
    #include 
    #include 
    int main(){
    int i,a,b; int j=0;
    for(i=2; i<200; i++){
            a=ceil((i-0.5)*sqrt(2));
            b=ceil((i-1.5)*sqrt(2));
            if(a-b==1)j++;
            else{j++; printf("%d,",j); j=0;}
    }
    return 0;
    }

Formula

a(1)=1, a(n+1) = floor(n*sqrt(2)+1/sqrt(2)) - floor((n-1)*sqrt(2)+1/sqrt(2)) + 1. - Michel Dekking, Jan 22 2017