OFFSET
0
COMMENTS
Parity of A009947.
This is the lexicographically earliest extensible binary sequence containing no palindromes of length 5 or more. It is impossible to avoid palindromes of length 4 in a binary sequence. Two zeros could be added at the beginning and still have no longer palindrome, but then it would be impossible to extend the sequence further back without creating a longer palindrome. - Franklin T. Adams-Watters, Nov 24 2013
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,1).
FORMULA
a(3*n) = 0; a(3*n+1) = n mod 2; a(3*n+2) = 1.
a(n) = a(n-3) + ((n mod 3) mod 2) * (1 - 2*a(n-3)) for n > 2.
a(n) = mod(n-1, 1 + mod(n, 3)). - Wesley Ivan Hurt, Aug 16 2014
G.f.: x^2*(1+x^2+x^3) / ((1-x)*(1+x)*(1-x+x^2)*(1+x+x^2)) = (x^2 + x^4 + x^5)/(1 - x^6). - Vaclav Kotesovec, Aug 18 2014
From Wesley Ivan Hurt, Jun 17 2016: (Start)
a(n) = a(n-6) for n > 5.
a(n) = -cos(n*Pi/6)*sin(n*Pi/6)*(sqrt(3)+2*sin(2*n*Pi/3)+4*sqrt(3)*sin((1-2*n)*Pi/6))/3. (End)
a(n) = floor(n/2) - floor(n/3) - floor(n/6). - Ridouane Oudra, Apr 09 2023
E.g.f.: (2*cosh(x) - sqrt(3)*cosh(x/2)*sin(sqrt(3)*x/2) + cos(sqrt(3)*x/2)*(sinh(x/2) - 2*cosh(x/2)) + sinh(x))/3. - Stefano Spezia, Jul 26 2024
MAPLE
MATHEMATICA
Table[Mod[n - 1, 1 + Mod[n, 3]], {n, 0, 100}] (* Wesley Ivan Hurt, Aug 16 2014 *)
PadRight[{}, 120, {0, 0, 1, 0, 1, 1}] (* or *) LinearRecurrence[{0, 0, 0, 0, 0, 1}, {0, 0, 1, 0, 1, 1}, 120] (* Harvey P. Dale, Nov 29 2014 *)
PROG
(Haskell)
a214090 = (`mod` 2) . a009947
(Magma) &cat[[0, 0, 1, 0, 1, 1]: n in [0..20]]; // Wesley Ivan Hurt, Jun 17 2016
(PARI) a(n)=[0, 0, 1, 0, 1, 1][n%6+1] \\ Charles R Greathouse IV, Jul 17 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Jul 06 2012
EXTENSIONS
Title changed by Franklin T. Adams-Watters, Nov 24 2013
STATUS
approved