A144611 Sturmian word of slope 2-sqrt(2).
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
Keywords
Links
- Danny Rorabaugh, Table of n, a(n) for n = 0..10000
- M. Lothaire, Algebraic combinatorics on words, Cambridge University Press. Online publication date: April 2013; Print publication year: 2002.
- Mike Winkler, On the structure and the behaviour of Collatz 3n+ 1 sequences, arXiv:1412.0519 [math.GM], 2014.
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
Comments