login
a(n) is the number of subsets of {1..n} that contain 3 even and 3 odd numbers.
4

%I #22 Dec 17 2022 17:40:54

%S 0,0,0,0,0,0,1,4,16,40,100,200,400,700,1225,1960,3136,4704,7056,10080,

%T 14400,19800,27225,36300,48400,62920,81796,104104,132496,165620,

%U 207025,254800,313600,380800,462400,554880,665856,790704,938961,1104660,1299600,1516200,1768900,2048200,2371600

%N a(n) is the number of subsets of {1..n} that contain 3 even and 3 odd numbers.

%H <a href="/index/Rec#order_12">Index entries for linear recurrences with constant coefficients</a>, signature (2,4,-10,-5,20,0,-20,5,10,-4,-2,1).

%F a(n) = binomial(n/2,3)^2, n even;

%F a(n) = binomial((n-1)/2,3)*binomial((n+1)/2,3), n odd.

%F From _Colin Barker_, Jan 21 2020: (Start)

%F G.f.: x^6*(1 + 2*x + 4*x^2 + 2*x^3 + x^4) / ((1 - x)^7*(1 + x)^5).

%F a(n) = 2*a(n-1) + 4*a(n-2) - 10*a(n-3) - 5*a(n-4) + 20*a(n-5) - 20*a(n-7) + 5*a(n-8) + 10*a(n-9) - 4*a(n-10) - 2*a(n-11) + a(n-12) for n>11.

%F (End)

%F E.g.f.: (cosh(x)-sinh(x))*(45+36*x+18*x^2+6*x^3+3*x^4+(-45+54*x-36*x^2+18*x^3-9*x^4+6*x^5+2*x^6)*(cosh(2*x)+sinh(2*x)))/4608. - _Stefano Spezia_, Jan 27 2020

%e a(7) = 4 and the 4 subsets are {1,2,3,4,5,6}, {1,2,3,4,6,7}, {1,2,4,5,6,7}, {2,3,4,5,6,7}.

%p a:= n-> ((b, q)-> b(q, 3)*b(n-q, 3))(binomial, iquo(n, 2)):

%p seq(a(n), n=0..50); # _Alois P. Heinz_, Jan 30 2020

%t a[n_] := If[OddQ[n], Binomial[(n - 1)/2, 3]*Binomial[(n + 1)/2, 3], Binomial[n/2, 3]^2]; Array[a, 45, 0] (* _Amiram Eldar_, Jan 21 2020 *)

%t LinearRecurrence[{2,4,-10,-5,20,0,-20,5,10,-4,-2,1},{0,0,0,0,0,0,1,4,16,40,100,200},50] (* _Harvey P. Dale_, Dec 17 2022 *)

%o (PARI) concat([0,0,0,0,0,0], Vec(x^6*(1 + 2*x + 4*x^2 + 2*x^3 + x^4) / ((1 - x)^7*(1 + x)^5) + O(x^40))) \\ _Colin Barker_, Jan 21 2020

%o (Magma) [IsEven(n) select Binomial((n div 2),3)^2 else Binomial((n-1) div 2,3)*Binomial((n+1) div 2,3): n in [0..45]]; // _Marius A. Burtea_, Jan 21 2020

%Y Cf. A028723 (2 even and 2 odd numbers).

%K nonn,easy

%O 0,8

%A _Enrique Navarrete_, Jan 20 2020