A144595 Christoffel word of slope 4/7.
0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1
Offset: 0
References
- J. Berstel et al., Combinatorics on Words: Christoffel Words and Repetitions in Words, Amer. Math. Soc., 2008.
Links
- J. Berstel et al., Combinatorics on Words: Christoffel Words and Repetitions in Words
Programs
-
Maple
christoffel:=proc(s,M) local n,x,y,ans; ans:=[0]; x:=1; y:=0; for n from 1 to M do if y+1 <= s*x then ans:=[op(ans),1]; y:=y+1; else ans:=[op(ans),0]; x:=x+1; fi; od: ans; end; christoffel(4/7,120);
-
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]; christoffel[4/7, 120] (* Jean-François Alcover, Sep 19 2016, adapted from Maple *)
-
PARI
\\ Christoffel word for nonnegative rational f. Cword(f) = {my(n = numerator(f), d = denominator(f), v = vector(n + d), c, s, t = 1, i = 1); v[#v] = 1; while(t<=#v-4, i++; c=(i*f>=s+1); if(c, i-=2; s++, t++); v[t+2]=c); v} a(n) = my(c = Cword(4/7)); c[(n-1)%#c+1] \\ David A. Corneth, Sep 19 2016
Formula
Period 11: 0,0,1,0,0,1,0,0,1,0,1.
a(n) = a(n-11).
G.f. -x^2*(1+x^3+x^6+x^8) / ( (x-1)*(1+x^10+x^9+x^8+x^7+x^6+x^5+x^4+x^3+x^2+x) ). - R. J. Mathar, Jul 09 2013
Comments