|
|
A342404
|
|
a(n) = binomial(n,2)*(2^(n-2) - n + 1).
|
|
0
|
|
|
0, 0, 0, 0, 6, 40, 165, 546, 1596, 4320, 11115, 27610, 66858, 158808, 371553, 858690, 1964280, 4454272, 10024407, 22410234, 49803750, 110096280, 242216205, 530573890, 1157621556, 2516575200, 5452587075, 11777596506, 25367140386, 54492386200, 116769410745
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,5
|
|
COMMENTS
|
a(n) is the number of ternary strings of length n with two 1's and at least two 0's.
Note the number of binary strings of length n with two 1's and at least two 0's is counted by a(n)=0, n < 4; a(n) = binomial(n,2), n >= 4 (e.g.f: (exp(x)-x-1)*x^2/2).
|
|
LINKS
|
|
|
FORMULA
|
E.g.f: exp(x)*(exp(x)-x-1)*x^2/2.
G.f.: x^4*(6 - 20*x + 17*x^2)/((1 - x)^4*(1 - 2*x)^3). - Stefano Spezia, Mar 12 2021
|
|
EXAMPLE
|
a(6)=165 since the strings are the 15 permutations of 110000, the 60 permutations of 110002, and the 90 permutations of 110022.
|
|
MATHEMATICA
|
a[n_]:=Binomial[n, 2]*(2^(n-2)-n+1)
LinearRecurrence[{10, -42, 96, -129, 102, -44, 8}, {0, 0, 0, 0, 6, 40, 165}, 50] (* Harvey P. Dale, May 14 2022 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|