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.

Showing 1-3 of 3 results.

A331408 Number of subsets of {1..n} that contain exactly three odd numbers.

Original entry on oeis.org

0, 0, 0, 0, 4, 8, 32, 64, 160, 320, 640, 1280, 2240, 4480, 7168, 14336, 21504, 43008, 61440, 122880, 168960, 337920, 450560, 901120, 1171456, 2342912, 2981888, 5963776, 7454720, 14909440, 18350080, 36700160, 44564480, 89128960, 106954752, 213909504, 254017536, 508035072, 597688320
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 three even numbers. For example, for n=6, 2*a(5)=8 and the 8 subsets are {2,4,6}, {1,2,4,6}, {2,3,4,6}, {2,4,5,6}, {1,2,3,4,6}, {1,2,4,5,6}, {2,3,4,5,6}, {1,2,3,4,5,6}.

Examples

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

Crossrefs

Cf. A330592.

Programs

  • Magma
    [IsOdd(n) select Binomial((n+1) div 2, 3)*2^((n-1) div 2) else Binomial((n div 2), 3)*2^(n div 2): n in [1..39]]; // Marius A. Burtea, Jan 17 2020
  • Mathematica
    a[n_] := If[OddQ[n], Binomial[(n + 1)/2, 3]*2^((n - 1)/2), Binomial[n/2, 3]*2^(n/2)]; Array[a, 39] (* Amiram Eldar, Jan 17 2020 *)
  • PARI
    concat([0,0,0,0], Vec(4*x^5*(1 + 2*x) / (1 - 2*x^2)^4 + O(x^40))) \\ Colin Barker, Jan 17 2020
    

Formula

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

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)

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

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 16, 32, 192, 384, 1344, 2688, 7168, 14336, 32256, 64512, 129024, 258048, 473088, 946176, 1622016, 3244032, 5271552, 10543104, 16400384, 32800768, 49201152, 98402304, 143130624, 286261248, 405536768, 811073536, 1123024896, 2246049792, 3048210432, 6096420864
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 5 even numbers.
In general, if a(n) is the number of subsets of {1..n} that contain k odd numbers, then a(n) = binomial((n+1)/2, k)*2^((n-1)/2) for n odd; a(n) = binomial((n/2), k)*2^(n/2) for n even, and 2*a(n-1), n > 1, is the number of subsets of {1..n} that contain k even numbers.
In terms of k, the number a(n) of subsets of {1..n} that contain k even numbers is a(n) = binomial((n-1)/2, k)*2^((n+1)/2) for n odd; a(n) = binomial((n/2), k)* 2^(n/2) for n even. Note that a triangle can be made for different values of k and n.

Examples

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

Crossrefs

Programs

  • Magma
    [IsOdd(n) select Binomial((n+1) div 2, 5)*2^((n-1) div 2) else Binomial((n div 2), 5)*2^(n div 2): n in [1..38]]; // Marius A. Burtea, Jan 17 2020
  • Mathematica
    a[n_] := If[OddQ[n], Binomial[(n + 1)/2, 5]*2^((n - 1)/2), Binomial[n/2, 5]*2^(n/2)]; Array[a, 38] (* Amiram Eldar, Jan 17 2020 *)
  • PARI
    concat([0,0,0,0,0,0,0,0], Vec(16*x^9*(1 + 2*x) / (1 - 2*x^2)^6 + O(x^40))) \\ Colin Barker, Jan 17 2020
    

Formula

a(n) = binomial((n+1)/2, 5) * 2^((n-1)/2), n odd;
a(n) = binomial((n/2), 5) * 2^(n/2), n even.
From Colin Barker, Jan 17 2020: (Start)
G.f.: 16*x^9*(1 + 2*x) / (1 - 2*x^2)^6.
a(n) = 12*a(n-2) - 60*a(n-4) + 160*a(n-6) - 240*a(n-8) + 192*a(n-10) - 64*a(n-12) for n>12. (End)
From Amiram Eldar, Mar 24 2022: (Start)
Sum_{n>=9} 1/a(n) = (5/64)*(12*log(2)-7).
Sum_{n>=9} (-1)^(n+1)/a(n) = (5/192)*(12*log(2)-7). (End)
Showing 1-3 of 3 results.