|
|
A241574
|
|
Number of ternary words of length n avoiding the pattern 11-11.
|
|
1
|
|
|
1, 3, 9, 27, 78, 222, 618, 1686, 4512, 11856, 30624, 77856, 195072, 482304, 1178112, 2846208, 6807552, 16134144, 37920768, 88449024, 204865536, 471465984, 1078591488, 2454061056, 5555355648, 12516851712, 28078768128, 62732107776, 139619991552, 309640298496, 684409749504, 1508036837376, 3313030397952
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
FORMULA
|
G.f.: (1 - 5*x + 9*x^2 - 5*x^3 - 2*x^4 + 6*x^5 - 6*x^6 + 6*x^7)/ (1 - 8*x + 24*x^2 - 32*x^3 + 16*x^4).
a(n) = 3*2^(n-7)*(16 + 36*n - n^2 + n^3) for n > 3. - Colin Barker, Jun 06 2015
a(n) = 8*a(n-1) - 24*a(n-2) + 32*a(n-3) - 16*a(n-4) for n > 7. - Colin Barker, Jun 06 2015
E.g.f.: (1/16)*(10 + 9*x + 3*x^2 + x^3 + (6 + 27*x + 3*x^2 + 3*x^3)*exp(2*x)). - G. C. Greubel, Sep 22 2023
|
|
MATHEMATICA
|
LinearRecurrence[{8, -24, 32, -16}, {1, 3, 9, 27, 78, 222, 618, 1686}, 41] (* G. C. Greubel, Sep 22 2023 *)
|
|
PROG
|
(PARI) Vec((6*x^7-6*x^6+6*x^5-2*x^4-5*x^3+9*x^2-5*x+1)/ (16*x^4-32*x^3+24*x^2-8*x+1) + O(x^100)) \\ Colin Barker, Jun 06 2015
(Magma)
A241574:= func< n | n le 3 select 3^n else 3*2^(n-7)*(16+36*n-n^2+n^3) >;
(SageMath)
def A241574(n): return 3^n if (n<4) else 3*2^(n-7)*(16 +36*n -n^2 +n^3)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|