OFFSET
0,2
COMMENTS
Also, number of length n ternary words with no pair of equal consecutive letters and avoiding the subwords 010, 101, 020, 202. - Miquel A. Fiol, Dec 22 2023
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..2000 (210 terms from R. H. Hardin)
FORMULA
a(n) = a(n-1) + a(n-3) for n>=5.
G.f.: (x^4 + x^3 + 3*x^2 + 2*x + 1) / (1 - x - x^3). - Colin Barker, Nov 05 2018
EXAMPLE
Some solutions for n=12:
0 1 0 1 1 0 2 2 0 2 0 2 0 0 0 1
0 2 1 2 0 0 1 2 1 1 0 2 0 0 1 2
0 2 0 2 0 1 2 1 0 2 0 2 0 0 0 2
0 2 0 1 0 0 2 2 0 2 1 1 1 1 0 1
0 1 1 2 0 0 2 2 0 2 0 2 0 0 0 2
0 2 0 2 1 1 2 1 1 1 0 2 0 0 0 2
0 2 0 2 0 0 1 2 0 2 0 2 0 0 1 2
0 2 0 2 0 0 2 2 0 2 0 2 0 0 0 2
0 1 1 2 1 1 2 1 0 2 0 1 1 0 0 1
0 2 0 1 0 0 2 2 0 2 0 2 0 0 0 2
0 2 0 2 0 0 2 2 0 1 1 2 0 0 0 2
0 2 0 2 1 0 1 1 0 2 0 1 0 0 1 2
MATHEMATICA
gf=(x^4 + x^3 + 3*x^2 + 2*x + 1) / (1 - x - x^3); Table[SeriesCoefficient[gf, {x, 0, n}], {n, 0, 40}] (* James C. McMahon, Dec 30 2023 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
R. H. Hardin, Aug 09 2014
EXTENSIONS
Edited by Alois P. Heinz, Dec 30 2023
STATUS
approved