login
A380445
a(n) = 10*binomial(n,5) + 6*binomial(n,4) + binomial(n,3) + binomial(n,2).
1
0, 0, 1, 4, 16, 60, 185, 476, 1064, 2136, 3945, 6820, 11176, 17524, 26481, 38780, 55280, 76976, 105009, 140676, 185440, 240940, 309001, 391644, 491096, 609800, 750425, 915876, 1109304, 1334116, 1593985, 1892860, 2234976, 2624864, 3067361, 3567620, 4131120, 4763676
OFFSET
0,4
COMMENTS
a(n) is the number of ternary strings of length n that contain zero or two 1's, two or three 2's, and have no restriction on the number of 0's.
FORMULA
a(n) = (1/3)*n - (17/12)*n^2 + (19/12)*n^3 - (7/12)*n^4 + (1/12)*n^5.
G.f.: (x^2*(4*x^3 + 7*x^2 - 2*x + 1))/(1 - x)^6.
E.g.f.: exp(x)*(1 + x^2/2)*(x^2/2 + x^3/6).
EXAMPLE
a(5) = 60 since the strings are the 10 permutations of 22000, the 10 permutations of 22200, the 30 permutations of 11220 and the 10 permutations of 11222.
MATHEMATICA
LinearRecurrence[{6, -15, 20, -15, 6, -1}, {0, 0, 1, 4, 16, 60}, 50] (* or *)
A380445[n_] := n*(n - 1)*(n*(n*(n - 6) + 13) - 4)/12;
Array[A380445, 50, 0] (* Paolo Xausa, Jun 25 2025 *)
CROSSREFS
Cf. A383797.
Sequence in context: A374096 A032094 A282083 * A261563 A265955 A217374
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, Jun 21 2025
STATUS
approved