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.

A331419 a(n) is the number of subsets of {1..n} that contain exactly 4 odd numbers.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 8, 16, 80, 160, 480, 960, 2240, 4480, 8960, 17920, 32256, 64512, 107520, 215040, 337920, 675840, 1013760, 2027520, 2928640, 5857280, 8200192, 16400384, 22364160, 44728320, 59637760, 119275520, 155975680, 311951360, 401080320, 802160640, 1016070144, 2032140288
Offset: 1

Views

Author

Enrique Navarrete, Jan 16 2020

Keywords

Comments

2*a(n-1) for n > 1 is the number of subsets of {1..n} that contain 4 even numbers. For example, for n=8, 2*a(7)=16 and the 16 subsets are {2,4,6,8}, {1,2,4,6,8}, {2,3,4,6,8}, {2,4,5,6,8}, {2,4,6,7,8}, {1,2,3,4,6,8}, {1,2,4,5,6,8}, {1,2,4,6,7,8}, {2,3,4,5,6,8}, {2,3,4,6,7,8}, {2,4,5,6,7,8}, {1,2,3,4,5,6,8}, {1,2,3,4,6,7,8}, {1,2,4,5,6,7,8}, {2,3,4,5,6,7,8}, {1,2,3,4,5,6,7,8}.

Examples

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

Crossrefs

Programs

  • Magma
    [IsOdd(n) select Binomial((n+1) div 2, 4)*2^((n-1) div 2) else Binomial((n div 2), 4)*2^(n div 2): n in [1..38]]; // Marius A. Burtea, Jan 17 2020
    
  • Mathematica
    a[n_] := If[OddQ[n], Binomial[(n + 1)/2, 4]*2^((n - 1)/2), Binomial[n/2, 4]*2^(n/2)]; Array[a, 38] (* Amiram Eldar, Jan 17 2020 *)
    LinearRecurrence[{0,10,0,-40,0,80,0,-80,0,32},{0,0,0,0,0,0,8,16,80,160},50] (* Harvey P. Dale, Jul 22 2024 *)
  • PARI
    concat([0,0,0,0,0,0], Vec(8*x^7*(1 + 2*x) / (1 - 2*x^2)^5 + O(x^40))) \\ Colin Barker, Jan 18 2020

Formula

a(n) = binomial((n+1)/2, 4) * 2^((n-1)/2), n odd;
a(n) = binomial((n/2), 4) * 2^(n/2), n even.
From Colin Barker, Jan 18 2020: (Start)
G.f.: 8*x^7*(1 + 2*x) / (1 - 2*x^2)^5.
a(n) = 10*a(n-2) - 40*a(n-4) + 80*a(n-6) - 80*a(n-8) + 32*a(n-10) for n>10. (End)
From Amiram Eldar, Mar 24 2022: (Start)
Sum_{n>=7} 1/a(n) = (5-6*log(2))/4.
Sum_{n>=7} (-1)^(n+1)/a(n) = (5-6*log(2))/12. (End)