OFFSET
0,1
COMMENTS
Conjecture: a(n) >= 0.
For n > 2, a(n) is the number of cyclic sequences (q1, q2, ..., qn) consisting of zeros, ones and twos such that each triple contains 0 and 1 at least once, provided the positions of the zeros and ones are fixed on a circle. For example, a(5)=20 because only the sequences (00101), (01001), (01010), (01011), (01012), (01021), (01101), (01201), (02101), (20101) and those obtained from them by exchanging 0 and 1 contain 0 and 1 in each triple (including triples q4, q5, q1 and q5, q1, q2). For n = 1, 2 the statement is still true provided we allow the sequence to wrap around itself on a circle. E.g., a(2) = 2 since only sequences 01 and 10 can be wrapped so one obtains (010) and (101), respectively. - Wojciech Florek, Nov 25 2021
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Wojciech Florek, A class of generalized Tribonacci sequences applied to counting problems, Appl. Math. Comput., 338 (2018), 809-821.
W. O. J. Moser, Cyclic binary strings without long runs of like (alternating) bits, Fibonacci Quart. 31(1) (1993), 2-6.
Index entries for linear recurrences with constant coefficients, signature (0,1,4,1,0,-1).
FORMULA
a(n) = a(n-2) + 4*a(n-3) + a(n-4) - a(n-6), a(0)=6, a(1)=0, a(2)=2, a(3)=12, a(4)=6, a(5)=20.
G.f.: (6 - 4*x^2 - 12*x^3 - 2*x^4)/(1 - x^2 - 4*x^3 - x^4 + x^6).
MATHEMATICA
CoefficientList[Series[(6-4*x^2-12*x^3-2*x^4)/(1-x^2-4*x^3-x^4+x^6), {x, 0, 40}], x]
PROG
(PARI) my(x='x+O('x^40)); Vec((6-4*x^2-12*x^3-2*x^4)/(1-x^2-4*x^3-x^4+x^6)) \\ G. C. Greubel, Apr 13 2019
(Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (6-4*x^2-12*x^3-2*x^4)/(1-x^2-4*x^3-x^4+x^6) )); // G. C. Greubel, Apr 13 2019
(Sage) ((6-4*x^2-12*x^3-2*x^4)/(1-x^2-4*x^3-x^4+x^6)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Apr 13 2019
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Mario Catalani (mario.catalani(AT)unito.it), Aug 31 2002
STATUS
approved