A373554 Number of ternary length-2 squarefree words of length n not containing the subwords 021 or 10.
1, 3, 5, 7, 11, 16, 24, 36, 53, 80, 118, 177, 263, 392, 585, 870, 1299, 1933, 2883, 4295, 6400, 9540, 14212, 21185, 31564, 47042, 70101, 104463, 155680, 231985, 345722, 515187, 767749, 1144111, 1704963, 2540784, 3786288, 5642420, 8408397
Offset: 0
Examples
For n=3 the a(3)=7 solutions are 012, 020, 120, 121, 201, 202, 212.
Links
- Index entries for linear recurrences with constant coefficients, signature (0,2,1,-1).
Formula
a(n) = 2*a(n-2) + a(n-3) - a(n-4).
G.f.: ((1+x)*(1+2*x+x^2-x^3))/(1-2*x^2-x^3+x^4).