|
|
A330010
|
|
Number of length-n ternary strings x with the property that if w is a subword of x and |w| >= 3, then w reversed is not a subword of x.
|
|
1
|
|
|
1, 3, 9, 18, 30, 48, 78, 126, 204, 330, 534, 864, 1398, 2262, 3660, 5922, 9582, 15504, 25086, 40590, 65676, 106266, 171942, 278208, 450150, 728358, 1178508, 1906866, 3085374, 4992240, 8077614, 13069854, 21147468, 34217322, 55364790, 89582112, 144946902
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
Also the number of length-n ternary words containing no palindromes of length > 2.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = 6*F(n+1) for n >= 3, where F(n) is the n-th Fibonacci number.
G.f.: (1 + 2*x + 5*x^2 + 6*x^3 + 3*x^4) / (1 - x - x^2).
a(n) = a(n-1) + a(n-2) for n>4.
(End)
|
|
EXAMPLE
|
For n = 4, the 30 strings are 0011, 0012, 0112, 0120, 0122 and the 25 similar strings formed by permutation of the alphabet.
|
|
MATHEMATICA
|
CoefficientList[Series[(1 + 2 x + 5 x^2 + 6 x^3 + 3 x^4)/(1 - x - x^2), {x, 0, 36}], x] (* Michael De Vlieger, Dec 01 2019 *)
|
|
PROG
|
(PARI) Vec((1 + 2*x + 5*x^2 + 6*x^3 + 3*x^4) / (1 - x - x^2) + O(x^40)) \\ Colin Barker, Nov 27 2019
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|