login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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)
Array[a, 30, 0] (* Giorgos Kalogeropoulos, Mar 31 2021 *)
LinearRecurrence[{10, -42, 96, -129, 102, -44, 8}, {0, 0, 0, 0, 6, 40, 165}, 50] (* Harvey P. Dale, May 14 2022 *)
CROSSREFS
Sequence in context: A227013 A073773 A001919 * A005553 A335232 A055344
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, Mar 10 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 04:17 EDT 2024. Contains 371696 sequences. (Running on oeis4.)