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.

A144611 Sturmian word of slope 2-sqrt(2).

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1
Offset: 0

Views

Author

N. J. A. Sloane, Jan 13 2009

Keywords

Comments

Old name was: Sturmian word of slope 2.
Conjecture: a(n) = floor((n+1)*log(3)/log(2)) - floor(n*log(3)/log(2)) - 1.
This is not true: Let b(n) = floor((n+1)*log(3)/log(2)) - floor(n*log(3)/log(2)) - 1. Then b(40) = 0, whereas a(40) = 1. This is the first term at which a(n) and b(n) disagree. - Danny Rorabaugh, Mar 14 2015
From Benoit Cloitre, Oct 16 2016: (Start)
Let u(n) = n + floor(sqrt(2)*n) (A003151) and v(n) = n + floor(n/sqrt(2)) (A003152) then u,v form a partition of the positive integers and we have, for n >= 1, a(u(n))=0 and a(v(n))=1.
Another way to construct the sequence: merge the sequences x(n) = 2n^2+1 and y(n) = 4n^2 (n >= 1) into an increasing sequence z(n) which then begins: 3,4,9,16,19,33,36,51,64,73 (not in the OEIS). Then for n >= 1, a(n) = z(n) mod 2. (End)
From Michel Dekking, Feb 16 2020: (Start)
This sequence is a Sturmian sequence s(alpha,rho) with slope alpha = 2-sqrt(2), and intercept rho = 0.
In general, one passes from slope alpha to slope 1-alpha by exchanging 0 and 1. It therefore follows from the Comments of A006337 that (a(n+1)) is the unique fixed point of the morphism 0 -> 101, 1 -> 10. (End)

Crossrefs

See A144595 for further details. Cf. A006337, A074840.

Programs

  • Mathematica
    christoffel[s_, M_] := Module[{n, x = 1, y = 0, ans = {0}}, Do[If[y + 1 <= s*x, AppendTo[ans, 1]; y++, AppendTo[ans, 0]; x++], {n, 1, M}]; ans] (* or Sturmian word, Jean-François Alcover, Sep 19 2016, A274170 *); christoffel[Sqrt[2], 105] (* Robert G. Wilson v, Feb 02 2017 *)
  • PARI
    \\ to get N terms
    a(n)=if(n<1,0,vecsort(concat(vector(floor(sqrt(2)*N),i,2*i^2+1),vector(N,j,4*j^2)))[n]%2) \\ Benoit Cloitre, Oct 16 2016
  • Sage
    #Generate the first n terms (plus a few) of the Sturmian word of slope a
    def Sturmian(a,n):
        y = 0
        A = []
        while len(A)<=n:
            y += a
            A.extend([0]+[1]*(floor(y)-floor(y-a)))
        return A
    Sturmian(sqrt(2),104)
    # Danny Rorabaugh, Mar 14 2015
    

Formula

a(n) = floor((n+1)*alpha) - floor(n*alpha), where alpha = 2-sqrt(2). - Michel Dekking, Feb 16 2020

Extensions

Name corrected by Michel Dekking, Feb 16 2020