OFFSET
0,3
COMMENTS
Number of ternary words of length n on {0,1,2} containing the subwords 02 or 20. - Philippe Deléham, Apr 27 2012
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
El-Mehdi Mehiri and Mohammed L. Nadji, The Power Contamination Problem on Grids Revisited: Optimality, Combinatorics, and Links to Integer Sequences, arXiv:2509.12756 [math.CO], 2025. See pp. 12, 14-15.
Gyula Tasi and Fujio Mizukami, Quantum algebraic-combinatoric study of the conformational properties of n-alkanes, J. Math. Chemistry, 25 (1999), 55-64 (see Eq. (19)).
Index entries for linear recurrences with constant coefficients, signature (5,-5,-3).
FORMULA
a(n) = 2*A137212(n).
From Philippe Deléham, Apr 27 2012: (Start)
G.f.: 2*x^2/((1-3*x)*(1-2*x-x^2)).
a(n) = 5*a(n-1) - 5*a(n-2) - 3*a(n-3), a(0) = a(1) = 0, a(2) = 2. (End)
a(n) = (1/2)*(2*3^n - A002203(n+1)). - G. C. Greubel, Jan 05 2022
E.g.f.: exp(x)*(exp(2*x) - cosh(sqrt(2)*x) - sqrt(2)*sinh(sqrt(2)*x)). - Stefano Spezia, Sep 21 2025
EXAMPLE
a(3) = 10 because among the 3^3 = 27 ternary words of length 3 only 10, namely 002, 020, 021, 022, 102, 120, 200, 201, 202, 220 contain the subwords 02 or 20. - Philippe Deléham, Apr 27 2012
MATHEMATICA
Table[(2*3^n - LucasL[n+1, 2])/2, {n, 0, 30}] (* G. C. Greubel, Jan 05 2022 *)
PROG
(Magma) [n le 3 select 2*Floor((n-1)/2) else 5*Self(n-1) -5*Self(n-2) -3*Self(n-3): n in [1..31]]; // G. C. Greubel, Jan 05 2022
(SageMath) [(2*3^n - lucas_number2(n+1, 2, -1))/2 for n in (0..30)] # G. C. Greubel, Jan 05 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jul 29 2011
STATUS
approved
