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.

A209816 Number of partitions of 2n in which every part is

Original entry on oeis.org

1, 3, 7, 15, 30, 58, 105, 186, 318, 530, 863, 1380, 2164, 3345, 5096, 7665, 11395, 16765, 24418, 35251, 50460, 71669, 101050, 141510, 196888, 272293, 374423, 512081, 696760, 943442, 1271527, 1706159, 2279700, 3033772, 4021695, 5311627, 6990367, 9168321
Offset: 1

Views

Author

Clark Kimberling, Mar 13 2012

Keywords

Comments

Also, the number of partitions of 3n in which n is the maximal part.
Also, the number of partitions of 3n into n parts. - Seiichi Manyama, May 07 2018
Also the number of multigraphical partitions of 2n, i.e., integer partitions that comprise the multiset of vertex-degrees of some multigraph. - Gus Wiseman, Oct 24 2018
Also number of partitions of 2n with at most n parts. Conjugate partitions map one to one to partitions of 2*n with each part <= n. - Wolfdieter Lang, May 21 2019

Examples

			The 7 partitions of 6 with parts <4 are as follows:
3+3, 3+2+1, 3+1+1+1
2+2+2, 2+2+1+1, 2+1+1+1+1
1+1+1+1+1+1.
Matching partitions of 2 into rationals as described:
1 + 1
1 + 3/3 + 1/3
1 + 1/3 + 1/3 + 1/3
2/3 + 2/3 + 2/3
2/3 + 2/3 + 1/3 + 1/3
2/3 + 1/3 + 1/3 + 1/3 + 1/3
1/3 + 1/3 + 1/3 + 1/3 + 1/3 + 1/3.
From _Seiichi Manyama_, May 07 2018: (Start)
n | Partitions of 3n into n parts
--+-------------------------------------------------
1 | 3;
2 | 5+1, 4+2, 3+3;
3 | 7+1+1, 6+2+1, 5+3+1, 5+2+2, 4+4+1, 4+3+2, 3+3+3; (End)
From _Gus Wiseman_, Oct 24 2018: (Start)
The a(1) = 1 through a(4) = 15 partitions:
  (11)  (22)    (33)      (44)
        (211)   (222)     (332)
        (1111)  (321)     (422)
                (2211)    (431)
                (3111)    (2222)
                (21111)   (3221)
                (111111)  (3311)
                          (4211)
                          (22211)
                          (32111)
                          (41111)
                          (221111)
                          (311111)
                          (2111111)
                          (11111111)
(End)
		

Crossrefs

Programs

  • Haskell
    a209816 n = p [1..n] (2*n) where
       p _          0 = 1
       p []         _ = 0
       p ks'@(k:ks) m = if m < k then 0 else p ks' (m - k) + p ks m
    -- Reinhard Zumkeller, Nov 14 2013
  • Maple
    b:= proc(n, i) option remember;
          `if`(n=0, 1, `if`(i<1, 0, b(n, i-1)+`if`(i>n, 0, b(n-i, i))))
        end:
    a:= n-> b(2*n, n):
    seq(a(n), n=1..50);  # Alois P. Heinz, Jul 09 2012
  • Mathematica
    f[n_] := Length[Select[IntegerPartitions[2 n], First[#] <= n &]]; Table[f[n], {n, 1, 30}] (* A209816 *)
    Table[SeriesCoefficient[Product[1/(1-x^k),{k,1,n}],{x,0,2*n}],{n,1,20}] (* Vaclav Kotesovec, May 25 2015 *)
    Table[Length@IntegerPartitions[3n, {n}], {n, 25}] (* Vladimir Reshetnikov, Jul 24 2016 *)
    b[n_, i_] := b[n, i] = If[n==0, 1, If[i<1, 0, b[n, i-1] + If[i>n, 0, b[n-i, i]]]]; a[n_] := b[2*n, n]; Table[a[n], {n, 1, 50}] (* Jean-François Alcover, Aug 29 2016, after Alois P. Heinz *)

Formula

a(n) = A000041(2*n)-A000070(n-1). - Matthew Vandermast, Jul 16 2012
a(n) = Sum_{k=1..n} A008284(2*n, k) = A000041(2*n) - A000070(n-1), for n >= 1. - Wolfdieter Lang, May 21 2019

Extensions

More terms from Alois P. Heinz, Jul 09 2012

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]

A231429 Number of partitions of 2n into distinct parts < n.

Original entry on oeis.org

1, 0, 0, 0, 0, 1, 2, 4, 8, 14, 22, 35, 53, 78, 113, 160, 222, 306, 416, 558, 743, 980, 1281, 1665, 2149, 2755, 3514, 4458, 5626, 7070, 8846, 11020, 13680, 16920, 20852, 25618, 31375, 38309, 46649, 56651, 68616, 82908, 99940, 120192, 144238, 172730, 206425
Offset: 0

Views

Author

Reinhard Zumkeller, Nov 14 2013

Keywords

Comments

From Gus Wiseman, Jun 17 2023: (Start)
Also the number of integer compositions of n with weighted sum 3*n, where the weighted sum of a sequence (y_1,...,y_k) is Sum_{i=1..k} i * y_i. The a(0) = 1 through a(9) = 14 compositions are:
() . . . . (11111) (3111) (3211) (3311) (3411)
(11211) (11311) (4121) (4221)
(12121) (11411) (5112)
(21112) (12221) (11511)
(13112) (12321)
(21131) (13131)
(21212) (13212)
(111122) (21231)
(21312)
(22122)
(31113)
(111141)
(111222)
(112113)
For partitions we have A363527, ranks A363531. For reversed partitions we have A363526, ranks A363530.
(End)

Examples

			a(5) = #{4+3+2+1} = 1;
a(6) = #{5+4+3, 5+4+2+1} = 2;
a(7) = #{6+5+3, 6+5+2+1, 6+4+3+1, 5+4+3+2} = 4;
a(8) = #{7+6+3, 7+6+2+1, 7+6+3, 7+5+3+1, 7+4+3+2, 6+5+4+1, 6+5+3+2, 6+4+3+2+1} = 8;
a(9) = #{8+7+3, 8+7+2+1, 8+6+4, 8+6+3+1, 8+5+4+1, 8+5+3+2, 8+4+3+2+1, 7+6+5, 7+6+4+1, 7+6+3+2, 7+5+4+2, 7+5+3+2+1, 6+5+4+3, 6+5+4+2+1} = 14.
		

Crossrefs

A000041 counts integer partitions, strict A000009.
A053632 counts compositions by weighted sum.
A264034 counts partitions by weighted sum, reverse A358194.
A304818 gives weighted sum of prime indices, reverse A318283.
A320387 counts multisets by weighted sum, zero-based A359678.

Programs

  • Haskell
    a231429 n = p [1..n-1] (2*n) where
       p _  0 = 1
       p [] _ = 0
       p (k:ks) m = if m < k then 0 else p ks (m - k) + p ks m
  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], Total[Accumulate[#]]==3n&]],{n,0,15}] (* Gus Wiseman, Jun 17 2023 *)
Showing 1-3 of 3 results.