A330300 a(n) is the number of subsets of {1..n} that contain exactly 2 odd and 3 even numbers.
0, 0, 0, 0, 0, 0, 3, 6, 24, 40, 100, 150, 300, 420, 735, 980, 1568, 2016, 3024, 3780, 5400, 6600, 9075, 10890, 14520, 17160, 22308, 26026, 33124, 38220, 47775, 54600, 67200, 76160, 92480, 104040, 124848, 139536, 165699, 184110, 216600, 239400, 279300, 307230, 355740, 389620, 448063
Offset: 0
Examples
a(7) = 6 and the 6 subsets are {1,2,3,4,6}, {1,2,4,5,6}, {1,2,4,6,7}, {2,3,4,5,6}, {2,3,4,6,7}, {2,4,5,6,7}.
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1,5,-5,-10,10,10,-10,-5,5,1,-1).
Programs
-
Mathematica
a[n_] := Binomial[Ceiling[n/2], 2] * Binomial[Floor[n/2], 3]; Array[a, 47, 0] (* Amiram Eldar, Mar 01 2020 *)
-
PARI
a(n) = binomial(ceil(n/2), 2) * binomial(floor(n/2), 3) \\ Andrew Howroyd, Mar 01 2020
-
PARI
concat([0,0,0,0,0,0], Vec(x^6*(3 + 3*x + 3*x^2 + x^3) / ((1 - x)^6*(1 + x)^5) + O(x^40))) \\ Colin Barker, Mar 02 2020
Formula
a(n) = binomial(ceiling(n/2), 2) * binomial(floor(n/2), 3).
From Colin Barker, Mar 01 2020: (Start)
G.f.: x^6*(3 + 3*x + 3*x^2 + x^3) / ((1 - x)^6*(1 + x)^5).
a(n) = a(n-1) + 5*a(n-2) - 5*a(n-3) - 10*a(n-4) + 10*a(n-5) + 10*a(n-6) - 10*a(n-7) - 5*a(n-8) + 5*a(n-9) + a(n-10) - a(n-11) for n>10.
(End)
E.g.f.: (x*(-15 + 3*x - 7*x^2 + 2*x^3 + x^4)*cosh(x) + (15 - 3*x + 12*x^2 - 3*x^3 + x^4 + x^5)*sinh(x))/384. - Stefano Spezia, Mar 02 2020
Comments