A098457 Farey Bisection Expansion of sqrt(7).
1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1
Offset: 1
Examples
G.f. = x + x^2 + x^4 + x^6 + x^7 + x^8 + x^9 + x^11 + x^13 + x^14 + x^15 + ...
Links
- N. J. A. Sloane, Stern-Brocot or Farey Tree
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,1).
Programs
-
Magma
&cat [[1, 1, 0, 1, 0, 1, 1]^^20]; // Wesley Ivan Hurt, Jul 11 2016
-
Maple
seq(op([1, 1, 0, 1, 0, 1, 1]), n=0..20); # Wesley Ivan Hurt, Jul 11 2016
-
Mathematica
LinearRecurrence[{0, 0, 0, 0, 0, 0, 1},{1, 1, 0, 1, 0, 1, 1},105] (* Ray Chandler, Aug 26 2015 *)
-
PARI
{a(n) = [1, 1, 0, 1, 0, 1, 1][(n-1)%7+1]}; /* Michael Somos, Dec 26 2016 */
Formula
From Wesley Ivan Hurt, Jul 11 2016: (Start)
G.f.: x * (1 + x + x^3 + x^5 + x^6) / (1 - x^7).
a(n) = a(n-7) for n>7.
a(n) = 1 - Sum_{k=1..4} floor((n + k)/7)*(-1)^k. (End)
a(n+1) = (-1)^(mod(mod(n, 7), 3)>0) * A131372(n). - Michael Somos, Dec 26 2016
Comments