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-6 of 6 results.

A239241 Number of partitions of n into distinct parts for which (number of odd parts) = (number of even parts).

Original entry on oeis.org

1, 0, 0, 1, 0, 2, 0, 3, 0, 4, 1, 5, 2, 6, 5, 7, 8, 8, 14, 9, 20, 11, 30, 13, 40, 17, 55, 23, 70, 32, 91, 45, 112, 65, 140, 91, 169, 128, 206, 177, 245, 241, 295, 323, 350, 429, 419, 559, 499, 722, 600, 921, 721, 1162, 874, 1452, 1062, 1800, 1299, 2210
Offset: 0

Views

Author

Clark Kimberling, Mar 13 2014

Keywords

Comments

a(n) = A240021(n,0). - Alois P. Heinz, Apr 02 2014

Examples

			a(9) = 4 counts these partitions:  81, 72, 63, 54.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2, 0,
         `if`(n=0, `if`(t=0, 1, 0 ), b(n, i-1, t)+`if`(i>n, 0,
          b(n-i, i-1, t+`if`(irem(i, 2)=1, 1, -1)))))
        end:
    a:= n-> b(n$2, 0):
    seq(a(n), n=0..60);  # Alois P. Heinz, Mar 15 2014
  • Mathematica
    z = 55; p[n_] := p[n] = IntegerPartitions[n]; d[u_] := d[u] = DeleteDuplicates[u]; g[u_] := g[u] = Length[u];
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] < Count[#, ?EvenQ] &]], {n, 0, z}] (* A239239 *)
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] <= Count[#, ?EvenQ] &]], {n, 0, z}] (* A239240 *)
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] == Count[#, ?EvenQ] &]], {n, 0, z}] (* A239241 *)
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] > Count[#, ?EvenQ] &]], {n, 0, z}] (* A239242 *)
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] >= Count[#, ?EvenQ] &]], {n, 0, z}] (* A239243 *)
    (* Peter J. C. Moses, Mar 10 2014 *)
    b[n_, i_, t_] := b[n, i, t] = If[n > i*(i+1)/2, 0, If[n==0, If[t==0, 1, 0], b[n, i-1, t] + If[i>n, 0, b[n-i, i-1, t + If[Mod[i, 2]==1, 1, -1]]]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Dec 27 2015, after Alois P. Heinz *)

Formula

a(n) + A239239(n) + A239242(n) = A000009(n) for n >=1.
a(n) = [x^n y^0] Product_{i>=1} 1+x^i*y^(2*(i mod 2)-1). - Alois P. Heinz, Apr 03 2014

A240021 Number T(n,k) of partitions of n into distinct parts, where k is the difference between the number of odd parts and the number of even parts; triangle T(n,k), n>=0, read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 0, 0, 1, 2, 1, 1, 1, 0, 1, 1, 1, 3, 1, 1, 1, 0, 2, 2, 2, 4, 1, 0, 1, 2, 1, 1, 4, 2, 4, 5, 1, 1, 1, 1, 2, 1, 2, 6, 3, 1, 6, 6, 1, 2, 2, 1, 3, 1, 5, 9, 3, 2, 9, 7, 2, 4, 3, 2, 3, 2, 8, 12, 4, 0, 1, 4, 12, 8, 3, 7, 4, 3, 4, 3, 14, 16, 4, 1, 1, 7, 16, 9, 6, 11, 5, 1, 4, 4, 6, 20, 20, 5, 2, 2
Offset: 0

Views

Author

Alois P. Heinz, Mar 31 2014

Keywords

Comments

T(n,k) is defined for all n >= 0, k in A001057. Row n contains all terms from the leftmost to the rightmost nonzero term. All other terms (not in the triangle) are equal to 0. First nonzero term of column k>=0 is at n = k^2, first nonzero term of column k<=0 is at n = k*(k+1).
T(n,k) = T(n+k,-k).
T(2n*(2n+1),2n) = A000041(n).
T(4n^2+14n+11,2n+2) = A000070(n).
T(n^2,n) = 1.
T(n^2,n-1) = 0.
T(n^2,n-2) = A209815(n+1).
T(n^2+1,n-1) = A000065(n).
T(n,0) = A239241(n).
Sum_{k<=-1} T(n,k) = A239239(n).
Sum_{k<=0} T(n,k) = A239240(n).
Sum_{k>=1} T(n,k) = A239242(n).
Sum_{k>=0} T(n,k) = A239243(n).
Sum_{k=-1..1} T(n,k) = A239881(n).
T(n,-1) + T(n,1) = A239880(n).
Sum_{k=-n..n} T(n,k) = A000009 (row sums).

Examples

			T(12,-3) = 1: [6,4,2].
T(12,-2) = 2: [10,2], [8,4].
T(12,-1) = 1: [12].
T(12,0) = 2: [6,3,2,1], [5,4,2,1].
T(12,1) = 6: [9,2,1], [8,3,1], [7,4,1], [7,3,2], [6,5,1], [5,4,3].
T(12,2) = 3: [11,1], [9,3], [7,5].
T(13,-1) = 6: [10,2,1], [8,4,1], [8,3,2], [7,4,2], [6,5,2], [6,4,3].
T(14,-2) = 3: [12,2], [10,4], [8,6].
Triangle T(n,k) begins:
: n\k : -3 -2 -1  0  1  2  3  ...
+-----+--------------------------
:  0  :           1
:  1  :              1
:  2  :        1
:  3  :           1, 1
:  4  :        1, 0, 0, 1
:  5  :           2, 1
:  6  :     1, 1, 0, 1, 1
:  7  :        1, 3, 1
:  8  :     1, 1, 0, 2, 2
:  9  :        2, 4, 1, 0, 1
: 10  :     2, 1, 1, 4, 2
: 11  :        4, 5, 1, 1, 1
: 12  :  1, 2, 1, 2, 6, 3
: 13  :     1, 6, 6, 1, 2, 2
: 14  :  1, 3, 1, 5, 9, 3
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n>i*(i+1)/2, 0, `if`(n=0, 1,
          expand(b(n, i-1)+`if`(i>n, 0, b(n-i, i-1)*x^(2*irem(i, 2)-1)))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=ldegree(p)..degree(p)))(b(n$2)):
    seq(T(n), n=0..20);
  • Mathematica
    b[n_, i_] := b[n, i] = If[n>i*(i+1)/2, 0, If[n == 0, 1, Expand[b[n, i-1] + If[i>n, 0, b[n-i, i-1]*x^(2*Mod[i, 2]-1)]]]]; T[n_] := Function[{p}, Table[ Coefficient[p, x, i], {i, Exponent[p, x, Min], Exponent[p, x]}]][b[n, n]]; Table[ T[n], {n, 0, 20}] // Flatten (* Jean-François Alcover, Feb 11 2015, after Alois P. Heinz *)
  • PARI
    N=20; q='q+O('q^N);
    e(n) = if(n%2!=0, u, 1/u);
    gf = prod(n=1,N, 1 + e(n)*q^n );
    V = Vec( gf );
    { for (j=1, #V,  \\ print triangle, including leading zeros
        for (i=0, N-j, print1("   "));  \\ padding
        for (i=-j+1, j-1, print1(polcoeff(V[j], i, u),", "));
        print();
    ); }
    /* Joerg Arndt, Apr 01 2014 */

Formula

G.f.: prod(n>=1, 1 + e(n)*q^n ) = 1 + sum(n>=1, e(n)*q^n * prod(k=1..n-1, 1+e(k)*q^k) ) where e(n) = u if n odd, otherwise 1/u; see Pari program. [Joerg Arndt, Apr 01 2014]

A239240 Number of partitions of n into distinct parts for which (number of odd parts) <= (number of even parts).

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 2, 4, 2, 6, 4, 9, 6, 13, 10, 18, 15, 24, 24, 32, 35, 43, 51, 56, 72, 74, 100, 97, 136, 128, 183, 168, 241, 222, 315, 290, 408, 381, 522, 497, 664, 647, 839, 837, 1054, 1081, 1317, 1384, 1641, 1767, 2035, 2242, 2519, 2831, 3108, 3555, 3828
Offset: 0

Views

Author

Clark Kimberling, Mar 13 2014

Keywords

Comments

a(n) = Sum_{k<=0} A240021(n,k). - Alois P. Heinz, Apr 02 2014

Examples

			a(7) = 4 counts these partitions:  61, 52, 43, 421.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2, 0,
         `if`(n=0, `if`(t<=0, 1, 0 ), b(n, i-1, t)+`if`(i>n, 0,
          b(n-i, i-1, t+`if`(irem(i, 2)=1, 1, -1)))))
        end:
    a:= n-> b(n$2, 0):
    seq(a(n), n=0..60);  # Alois P. Heinz, Mar 15 2014
  • Mathematica
    z = 55; p[n_] := p[n] = IntegerPartitions[n]; d[u_] := d[u] = DeleteDuplicates[u]; g[u_] := g[u] = Length[u];
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] < Count[#, ?EvenQ] &]], {n, 0, z}] (* A239239 *)
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] <= Count[#, ?EvenQ] &]], {n, 0, z}] (* A239240 *)
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] == Count[#, ?EvenQ] &]], {n, 0, z}] (* A239241 *)
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] > Count[#, ?EvenQ] &]], {n, 0, z}] (* A239242 *)
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] >= Count[#, ?EvenQ] &]], {n, 0, z}] (* A239243 *)
    (* Peter J. C. Moses, Mar 10 2014 *)
    b[n_, i_, t_] := b[n, i, t] = If[n>i*(i+1)/2, 0, If[n==0, If[t <= 0, 1, 0], b[n, i-1, t] + If[i>n, 0, b[n-i, i-1, t+If[Mod[i, 2]==1, 1, -1]]]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Aug 30 2016, after Alois P. Heinz *)

Formula

a(n) + A239242(n) = A000009(n) for n >=1.

A239243 Number of partitions of n into distinct parts for which (number of odd parts) >= (number of even parts).

Original entry on oeis.org

1, 1, 0, 2, 1, 3, 2, 4, 4, 6, 7, 8, 11, 11, 17, 16, 25, 22, 36, 31, 49, 44, 68, 61, 90, 85, 120, 118, 156, 160, 204, 217, 261, 291, 337, 386, 429, 507, 548, 662, 694, 854, 882, 1096, 1112, 1396, 1406, 1765, 1768, 2219, 2223, 2776, 2784, 3451, 3484, 4275
Offset: 0

Views

Author

Clark Kimberling, Mar 13 2014

Keywords

Comments

a(n) = Sum_{k>=0} A240021(n,k). - Alois P. Heinz, Apr 02 2014

Examples

			a(8) = 4 counts these partitions:  71, 53, 521, 431.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2, 0,
         `if`(n=0, `if`(t>=0, 1, 0 ), b(n, i-1, t)+`if`(i>n, 0,
          b(n-i, i-1, t+`if`(irem(i, 2)=1, 1, -1)))))
        end:
    a:= n-> b(n$2, 0):
    seq(a(n), n=0..60);  # Alois P. Heinz, Mar 15 2014
  • Mathematica
    z = 55; p[n_] := p[n] = IntegerPartitions[n]; d[u_] := d[u] = DeleteDuplicates[u]; g[u_] := g[u] = Length[u];
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] < Count[#, ?EvenQ] &]], {n, 0, z}] (* A239239 *)
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] <= Count[#, ?EvenQ] &]], {n, 0, z}] (* A239240 *)
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] == Count[#, ?EvenQ] &]], {n, 0, z}] (* A239241 *)
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] > Count[#, ?EvenQ] &]], {n, 0, z}] (* A239242 *)
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] >= Count[#, ?EvenQ] &]], {n, 0, z}] (* A239243 *)
    (* Peter J. C. Moses, Mar 10 2014 *)
    b[n_, i_, t_] := b[n, i, t] = If[n>i*(i+1)/2, 0, If[n==0, If[t>=0, 1, 0], b[n, i-1, t]+If[i>n, 0, b[n-i, i-1, t+If[Mod[i, 2]==1, 1, -1]]]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Aug 30 2016, after Alois P. Heinz *)

Formula

a(n) + A239239(n) = A000009(n) for n >=1.

A239239 Number of strict partitions of n having fewer odd parts than even.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 2, 1, 2, 2, 3, 4, 4, 7, 5, 11, 7, 16, 10, 23, 15, 32, 21, 43, 32, 57, 45, 74, 66, 96, 92, 123, 129, 157, 175, 199, 239, 253, 316, 320, 419, 406, 544, 514, 704, 652, 898, 825, 1142, 1045, 1435, 1321, 1798, 1669, 2234, 2103, 2766, 2646, 3404
Offset: 0

Views

Author

Clark Kimberling, Mar 13 2014

Keywords

Comments

a(n) = Sum_{k<=-1} A240021(n,k). - Alois P. Heinz, Apr 02 2014

Examples

			a(6) counts these partitions:  6, 42.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n>i*(i+1)/2, 0,
         `if`(n=0, `if`(t<0, 1, 0 ), b(n, i-1, t)+`if`(i>n, 0,
          b(n-i, i-1, t+`if`(irem(i, 2)=1, 1, -1)))))
        end:
    a:= n-> b(n$2, 0):
    seq(a(n), n=0..60);  # Alois P. Heinz, Mar 15 2014
  • Mathematica
    z = 55; p[n_] := p[n] = IntegerPartitions[n]; d[u_] := d[u] = DeleteDuplicates[u]; g[u_] := g[u] = Length[u];
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] < Count[#, ?EvenQ] &]], {n, 0, z}] (* A239239 *)
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] <= Count[#, ?EvenQ] &]], {n, 0, z}] (* A239240 *)
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] == Count[#, ?EvenQ] &]], {n, 0, z}] (* A239241 *)
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] > Count[#, ?EvenQ] &]], {n, 0, z}] (* A239242 *)
    Table[g[Select[Select[p[n], d[#] == # &], Count[#, ?OddQ] >= Count[#, ?EvenQ] &]], {n, 0, z}] (* A239243 *)
    (* Peter J. C. Moses, Mar 10 2014 *)
    b[n_, i_, t_] := b[n, i, t] = If[n>i*(i+1)/2, 0, If[n == 0, If[t<0, 1, 0], b[n, i-1, t] + If[i>n, 0, b[n-i, i-1, t+If[Mod[i, 2] == 1, 1, -1]]]]]; a[n_] := b[n, n, 0]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Aug 29 2016, after Alois P. Heinz *)

Formula

a(n) + A239243(n) = A000009(n) for n >=1.

A276129 a(n) is the number of ordered ways to tile a strip of length n+2 with white tiles of odd lengths summing to length n and two red squares.

Original entry on oeis.org

1, 3, 6, 13, 27, 54, 106, 204, 387, 725, 1344, 2469, 4500, 8145, 14652, 26213, 46665, 82704, 145982, 256722, 449937, 786109, 1369494, 2379447, 4123944, 7130895, 12303714, 21186013, 36411399, 62466906, 106987282, 182946888, 312367887, 532587461, 906840060
Offset: 0

Views

Author

Gregory L. Simay, Aug 21 2016

Keywords

Comments

a(n) is a specific case of b(r,n), the number of ordered ways to rearrange a tiling of length n + r, with odd(1,3,5...) white tiles summing to n and r red squares.
Define the following summation: b(0,r,n) = b(r,n); b(1,r,n) = b(r, n-2) + b(r, n-4) + b(r, n-6) + ..; b(s, r, n) = b(s-1, r, n-2) + b(s-1, r, n-4) + b(r-1, s, n-6) + ...
The number of compositions of n with exactly r even numbers is b(r, r, n-2r).
Except for the initial 1, this is the p-INVERT transform of (1,0,1,0,1,0,...) for p(S) = (1 - S)^3. See A291219. - Clark Kimberling, Sep 04 2017

Examples

			Let 1,3 be the lengths of the odd tiles summing to 3 and let r,r be the two odd squares. Then the resulting number of compositions is a(3) = 13. The 6 compositions are 3,r,r; r,3,r; r,r,3; 1,1,1,r,r; 1,1,r,r,1; 1,r,r,1,1; r,r,1,1,1; 1,1,r,1,r; 1,r,1,r,1; r,1,r,1,1; r,1,1,r,1; 1,r,1,1,r; r,1,1,1,r.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, m) option remember;
          `if`(n+m=0, 1, `if`(m>0, b(n, m-1), 0)+
          add(`if`(j::odd, b(n-j, m), 0), j=1..n))
        end:
    a:= n-> b(n, 2):
    seq(a(n), n=0..50);  # Alois P. Heinz, Aug 29 2016
  • Mathematica
    a[0] = 1; a[n_] := Sum[Binomial[n - 2*k + 2, 2]*Binomial[n - k - 1, k], {k, 0, (n - 1)/2}];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Dec 27 2017, after Andrew Howroyd *)
  • PARI
    a(n)={if(n<=0, n==0, sum(k=0, (n-1)\2, binomial(n-2*k+2, 2)*binomial(n-k-1, k)))} \\ Andrew Howroyd, Dec 26 2017

Formula

a(n) = Sum_{k=0..floor((n-1)/2)} binomial(n-2*k+2, 2)*binomial(n-k-1, k) for n > 0. - Andrew Howroyd, Dec 26 2017
b(0,0)=1. For n>=1, b(0,n) = b(0,0,n) = the n-th Fibonacci number, A000045(n).
b(1,0)=1. For n>=1, b(1,n) = A239342(n+1).
b(2,n) = a(n) = a(n-1) + a(n-2) + A239342(n+1) + A239342(n-1).
G.f. for b(2,n): ((1-x^2)/(1-x-x^2))^3.
G.f. for b(r,n): ((1-x^2)/(1-x-x^2))^(r+1).
b(1,1,n) = A029907(n+1).
b(r,n) = b(r, n-1) + b(r, n-2) + b(r-1, n) - b(r-1, n-2).
b(r,r,n) = b(r-1, r-1, n) + b(r, r, n-1) + b(r, r, n-2).
G.f. for b(r,r,n): (1-x^2)/((1-x-x^2)^(r+1)).

Extensions

More terms from Alois P. Heinz, Aug 29 2016
Showing 1-6 of 6 results.