cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A331576 a(n) is the number of subsets of {1..n} that contain 5 even and 5 odd numbers.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 36, 126, 441, 1176, 3136, 7056, 15876, 31752, 63504, 116424, 213444, 365904, 627264, 1019304, 1656369, 2576574, 4008004, 6012006, 9018009, 13117104, 19079424, 27029184, 38291344, 53018784, 73410624, 99628704, 135210384, 180280512, 240374016, 315490896
Offset: 0

Views

Author

Enrique Navarrete, Jan 20 2020

Keywords

Comments

In general, the number of subsets of {1..n} that contain k even and k odd numbers is given by binomial(n/2, k)^2 for n even and binomial((n-1)/2, k)*binomial((n+1)/2, k) for n odd.

Examples

			a(11)=6 and the 6 subsets are {1,2,3,4,5,6,7,8,9,10}, {1,2,3,4,5,6,7,8,10,11}, {1,2,3,4,5,6,8,9,10,11}, {1,2,3,4,6,7,8,9,10,11}, {1,2,4,5,6,7,8,9,10,11}, {2,3,4,5,6,7,8,9,10,11}.
		

Crossrefs

Cf. A028723 (k=2), A331574 (k=3), A331575 (k=4). See comment.

Programs

  • Magma
    [IsOdd(n) select Binomial((n-1) div 2,5)*Binomial((n+1) div 2,5) else Binomial(n div 2,5)^2: n in [0..41]]; // Marius A. Burtea, Jan 21 2020
  • Maple
    a:= n-> ((b, q)-> b(q, 5)*b(n-q, 5))(binomial, iquo(n, 2)):
    seq(a(n), n=0..50);  # Alois P. Heinz, Jan 30 2020
  • Mathematica
    a[n_] := If[OddQ[n], Binomial[(n - 1)/2, 5]*Binomial[(n + 1)/2, 5], Binomial[n/2, 5]^2]; Array[a, 42, 0] (* Amiram Eldar, Jan 21 2020 *)
  • PARI
    concat([0,0,0,0,0,0,0,0,0,0], Vec(x^10*(1 + 4*x + 16*x^2 + 24*x^3 + 36*x^4 + 24*x^5 + 16*x^6 + 4*x^7 + x^8) / ((1 - x)^11*(1 + x)^9) + O(x^40))) \\ Colin Barker, Jan 21 2020
    

Formula

a(n) = binomial(n/2, 5)^2, for n even;
a(n) = binomial((n-1)/2, 5)*binomial((n+1)/2,5), for n odd.
From Colin Barker, Jan 21 2020: (Start)
G.f.: x^10*(1 + 4*x + 16*x^2 + 24*x^3 + 36*x^4 + 24*x^5 + 16*x^6 + 4*x^7 + x^8) / ((1 - x)^11*(1 + x)^9).
a(n) = 2*a(n-1) + 8*a(n-2) - 18*a(n-3) - 27*a(n-4) + 72*a(n-5) + 48*a(n-6) - 168*a(n-7) - 42*a(n-8) + 252*a(n-9) - 252*a(n-11) + 42*a(n-12) + 168*a(n-13) - 48*a(n-14) - 72*a(n-15) + 27*a(n-16) + 18*a(n-17) - 8*a(n-18) - 2*a(n-19) + a(n-20) for n>19.
(End)
E.g.f.: (cosh(x) - sinh(x))*(99225 + 88200*x + 40950*x^2 + 13050*x^3 + 3225*x^4 + 660*x^5 + 120*x^6 + 20*x^7 + 5*x^8 + (-99225 + 110250*x - 63000*x^2 + 24750*x^3 - 7575*x^4 + 1950*x^5 - 450*x^6 + 100*x^7 - 25*x^8 + 10*x^9 + 2*x^10)*(cosh(2*x) + sinh(2*x)))/29491200. - Stefano Spezia, Jan 27 2020