OFFSET
0,8
COMMENTS
The general formula for the number of subsets of {1..n} that contain exactly k odd and j even numbers is binomial(ceiling(n/2), k) * binomial(floor(n/2), j).
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).
FORMULA
a(n) = binomial(ceiling(n/2),4) * floor(n/2).
From Colin Barker, Mar 17 2020: (Start)
G.f.: x^7*(3 + x + x^2) / ((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)
EXAMPLE
a(8)=4 and the 4 subsets are {1,2,3,5,7}, {1,3,4,5,7}, {1,3,5,6,7}, {1,3,5,7,8}.
MATHEMATICA
Array[Binomial[Ceiling[#], 4] Binomial[Floor[#], 1] &[#/2] &, 47, 0] (* Michael De Vlieger, Mar 14 2020 *)
PROG
(PARI) concat([0, 0, 0, 0, 0, 0, 0], Vec(x^7*(3 + x + x^2) / ((1 - x)^6*(1 + x)^5) + O(x^50))) \\ Colin Barker, Mar 17 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, Mar 14 2020
STATUS
approved