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.

A383351 Triangle read by rows: T(n, k) is the number of partitions of a 2-colored set of n objects into k parts where 0 <= k <= n, and each part is one of 2 kinds.

Original entry on oeis.org

1, 0, 4, 0, 6, 10, 0, 8, 24, 20, 0, 10, 53, 60, 35, 0, 12, 88, 164, 120, 56, 0, 14, 144, 348, 370, 210, 84, 0, 16, 208, 672, 904, 700, 336, 120, 0, 18, 299, 1174, 1998, 1870, 1183, 504, 165, 0, 20, 400, 1952, 3952, 4524, 3360, 1848, 720, 220
Offset: 0

Views

Author

Peter Dolland, Apr 24 2025

Keywords

Examples

			Triangle starts:
 0 : [1]
 1 : [0,  4]
 2 : [0,  6,  10]
 3 : [0,  8,  24,   20]
 4 : [0, 10,  53,   60,   35]
 5 : [0, 12,  88,  164,  120,   56]
 6 : [0, 14, 144,  348,  370,  210,   84]
 7 : [0, 16, 208,  672,  904,  700,  336,  120]
 8 : [0, 18, 299, 1174, 1998, 1870, 1183,  504,  165]
 9 : [0, 20, 400, 1952, 3952, 4524, 3360, 1848,  720, 220]
10 : [0, 22, 534, 3052, 7394, 9834, 8652, 5488, 2724, 990, 286]
...
		

Crossrefs

Main diagonal gives A000292(n+1).
Partial row sums are A383352.
Cf. A382342 (1-colored), A382339 (1-kind), A008284 (1-colored, 1-kind).

Programs

  • Python
    from sympy import binomial
    from sympy.utilities.iterables import partitions
    def calc_w(k , m):
        s = 0
        for p in partitions(m, m=k+1):
            fact = 1
            j = k + 1
            for x in p :
                fact *= binomial(j, p[x]) * (x + 1) ** p[x]
                j -= p[x]
            s += fact
        return s
    def t_row(n):
        if n == 0 : return [1]
        t = list([0] * n)
        for p in partitions( n):
            fact = 1
            s = 0
            for k in p :
                s += p[k]
                fact *= calc_w(k, p[k])
            if s > 0 :
                t[s - 1] += fact
        return [0] + t

Formula

T(n,n) = binomial(n + 3, 3) = A000292(n + 1).
T(n,1) = 2*n + 2 for n >= 1.
T(n,k+1) = A383352(n,k+1) - A383352(n,k) for 0 <= k < n.

A382340 Triangle read by rows: T(n,k) is the number of partitions of a 3-colored set of n objects into exactly k parts with 0 <= k <= n.

Original entry on oeis.org

1, 0, 3, 0, 6, 6, 0, 10, 18, 10, 0, 15, 51, 36, 15, 0, 21, 105, 123, 60, 21, 0, 28, 208, 326, 226, 90, 28, 0, 36, 360, 771, 678, 360, 126, 36, 0, 45, 606, 1641, 1836, 1161, 525, 168, 45, 0, 55, 946, 3271, 4431, 3403, 1775, 721, 216, 55, 0, 66, 1446, 6096, 10026, 8982, 5472, 2520, 948, 270, 66
Offset: 0

Views

Author

Peter Dolland, Mar 22 2025

Keywords

Examples

			Triangle starts:
 0 : [1]
 1 : [0,  3]
 2 : [0,  6,    6]
 3 : [0, 10,   18,   10]
 4 : [0, 15,   51,   36,    15]
 5 : [0, 21,  105,  123,    60,   21]
 6 : [0, 28,  208,  326,   226,   90,   28]
 7 : [0, 36,  360,  771,   678,  360,  126,   36]
 8 : [0, 45,  606, 1641,  1836, 1161,  525,  168,  45]
 9 : [0, 55,  946, 3271,  4431, 3403, 1775,  721, 216,  55]
10 : [0, 66, 1446, 6096, 10026, 8982, 5472, 2520, 948, 270, 66]
...
		

Crossrefs

Row sums are A217093.
The 1-color case is A008284.
The 2-color case is A382339.
Cf. A382045.

Programs

  • Maple
    b:= proc(n, i) option remember; expand(`if`(n=0, 1, `if`(i<1, 0, add(
          b(n-i*j, min(n-i*j, i-1))*binomial(i*(i+3)/2+j, j)*x^j, j=0..n/i))))
        end:
    T:= (n, k)-> coeff(b(n$2), x, k):
    seq(seq(T(n, k), k=0..n), n=0..10);  # Alois P. Heinz, Mar 22 2025
  • Mathematica
    b[n_, i_] := b[n, i] = Expand[If[n == 0, 1, If[i < 1, 0, Sum[b[n - i*j, Min[n - i*j, i - 1]]*Binomial[i*(i + 3)/2 + j, j]*x^j, {j, 0, n/i}]]]];
    T[n_, k_] := Coefficient[b[n, n], x, k];
    Table[Table[T[n, k], {k, 0, n}], {n, 0, 10}] // Flatten (* Jean-François Alcover, Apr 17 2025, after Alois P. Heinz *)
  • Python
    from sympy import binomial
    from sympy.utilities.iterables import partitions
    colors = 3 - 1   # the number of colors - 1
    def t_row( n):
        if n == 0 : return [1]
        t = list( [0] * n)
        for p in partitions( n):
            fact = 1
            s = 0
            for k in p :
                s += p[k]
                fact *= binomial( binomial( k + colors, colors) + p[k] - 1, p[k])
            if s > 0 :
                t[s - 1] += fact
        return [0] + t

Formula

T(n,1) = binomial(n + 2, 2) = A000217(n + 1) for n >= 1.
T(n,n) = binomial(n + 2, 2) = A000217(n + 1).
T(n,k) = A382045(n,k) - A382045(n,k-1) for k >= 1.

A382341 Triangle read by rows: T(n,k) is the number of partitions of a 4-colored set of n objects into exactly k parts with 0 <= k <= n.

Original entry on oeis.org

1, 0, 4, 0, 10, 10, 0, 20, 40, 20, 0, 35, 135, 100, 35, 0, 56, 340, 420, 200, 56, 0, 84, 784, 1370, 950, 350, 84, 0, 120, 1596, 3900, 3580, 1800, 560, 120, 0, 165, 3070, 9905, 11835, 7425, 3045, 840, 165, 0, 220, 5500, 23180, 34780, 27020, 13360, 4760, 1200, 220
Offset: 0

Views

Author

Peter Dolland, Mar 22 2025

Keywords

Examples

			Triangle starts:
 0 : [1]
 1 : [0,   4]
 2 : [0,  10,   10]
 3 : [0,  20,   40,    20]
 4 : [0,  35,  135,   100,    35]
 5 : [0,  56,  340,   420,   200,    56]
 6 : [0,  84,  784,  1370,   950,   350,    84]
 7 : [0, 120, 1596,  3900,  3580,  1800,   560,   120]
 8 : [0, 165, 3070,  9905, 11835,  7425,  3045,   840,  165]
 9 : [0, 220, 5500, 23180, 34780, 27020, 13360,  4760, 1200,  220]
10 : [0, 286, 9466, 50480, 94030, 87992, 51886, 21840, 7020, 1650, 286]
...
		

Crossrefs

Row sums are A255050.
The 1-color case is A008284.
The 2-color case is A382339.
The 3-color case is A382340.
Cf. A382241.

Programs

  • Maple
    b:= proc(n, i) option remember; expand(`if`(n=0, 1, `if`(i<1, 0, add(
          b(n-i*j, min(n-i*j, i-1))*binomial(i*(i^2+6*i+11)/6+j, j)*x^j, j=0..n/i))))
        end:
    T:= (n, k)-> coeff(b(n$2), x, k):
    seq(seq(T(n, k), k=0..n), n=0..10);  # Alois P. Heinz, Mar 22 2025
  • Mathematica
    b[n_, i_] := b[n, i] = Expand[If[n == 0, 1, If[i < 1, 0, Sum[b[n - i*j, Min[n - i*j, i - 1]]*Binomial[i*(i^2 + 6*i + 11)/6 + j, j]*x^j, {j, 0, n/i}]]]];
    T[n_, k_] := Coefficient[b[n, n], x, k];
    Table[Table[T[n, k], {k, 0, n}], {n, 0, 10}] // Flatten (* Jean-François Alcover, Apr 17 2025, after Alois P. Heinz *)
  • Python
    from sympy import binomial
    from sympy.utilities.iterables import partitions
    colors = 4 - 1   # the number of colors - 1
    def t_row( n):
        if n == 0 : return [1]
        t = list( [0] * n)
        for p in partitions( n):
            fact = 1
            s = 0
            for k in p :
                s += p[k]
                fact *= binomial( binomial( k + colors, colors) + p[k] - 1, p[k])
            if s > 0 :
                t[s - 1] += fact
        return [0] + t

Formula

T(n,1) = binomial(n + 3, 3) = A000292(n + 1) for n >= 1.
T(n,n) = binomial(n + 3, 3) = A000292(n + 1).
T(n,k) = A382241(n,k) - A382241(n,k-1) for k >= 1.
Showing 1-3 of 3 results.