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

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

Original entry on oeis.org

1, 0, 2, 0, 3, 3, 0, 4, 6, 4, 0, 5, 14, 9, 5, 0, 6, 22, 24, 12, 6, 0, 7, 37, 49, 34, 15, 7, 0, 8, 52, 92, 76, 44, 18, 8, 0, 9, 76, 157, 162, 103, 54, 21, 9, 0, 10, 100, 260, 302, 232, 130, 64, 24, 10, 0, 11, 135, 400, 554, 468, 302, 157, 74, 27, 11
Offset: 0

Views

Author

Peter Dolland, Mar 22 2025

Keywords

Examples

			Triangle begins:
 0 : [1]
 1 : [0,  2]
 2 : [0,  3,   3]
 3 : [0,  4,   6,   4]
 4 : [0,  5,  14,   9,   5]
 5 : [0,  6,  22,  24,  12,   6]
 6 : [0,  7,  37,  49,  34,  15,   7]
 7 : [0,  8,  52,  92,  76,  44,  18,   8]
 8 : [0,  9,  76, 157, 162, 103,  54,  21,  9]
 9 : [0, 10, 100, 260, 302, 232, 130,  64, 24, 10]
10 : [0, 11, 135, 400, 554, 468, 302, 157, 74, 27, 11]
...
		

Crossrefs

Row sums are A005380.
The 1-color case is A008284.
Cf. A381891.

Programs

  • Maple
    b:= proc(n, i) option remember; expand(`if`(n=0 or i=1, (n+1)*x^n,
          add(b(n-i*j, min(n-i*j, i-1))*binomial(i+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 || i == 1, (n + 1)*x^n, Sum[b[n - i*j, Min[n - i*j, i - 1]]*Binomial[i + 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
    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( k + p[k], p[k])
            if s > 0 :
                t[s - 1] += fact
        return [0] + t

Formula

T(n,1) = n + 1 for n >= 1.
T(n,n) = n + 1.
T(n,k) = A381891(n,k) - A381891(n,k-1) for k >= 1.

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

Original entry on oeis.org

1, 0, 3, 0, 6, 12, 0, 10, 28, 38, 0, 15, 66, 102, 117, 0, 21, 126, 249, 309, 330, 0, 28, 236, 562, 788, 878, 906, 0, 36, 396, 1167, 1845, 2205, 2331, 2367, 0, 45, 651, 2292, 4128, 5289, 5814, 5982, 6027, 0, 55, 1001, 4272, 8703, 12106, 13881, 14602, 14818, 14873, 0, 66, 1512, 7608, 17634, 26616, 32088, 34608, 35556, 35826, 35892
Offset: 0

Views

Author

Peter Dolland, Mar 13 2025

Keywords

Comments

The 1-color case is Euler's table A026820.
The 2-color case is A381891.

Examples

			Triangle starts:
 0 : [1]
 1 : [0,  3]
 2 : [0,  6,   12]
 3 : [0, 10,   28,   38]
 4 : [0, 15,   66,  102,   117]
 5 : [0, 21,  126,  249,   309,   330]
 6 : [0, 28,  236,  562,   788,   878,   906]
 7 : [0, 36,  396, 1167,  1845,  2205,  2331,  2367]
 8 : [0, 45,  651, 2292,  4128,  5289,  5814,  5982,  6027]
 9 : [0, 55, 1001, 4272,  8703, 12106, 13881, 14602, 14818, 14873]
10 : [0, 66, 1512, 7608, 17634, 26616, 32088, 34608, 35556, 35826, 35892]
...
		

Crossrefs

Main diagonal gives A217093.

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:= proc(n, k) option remember;
         `if`(k<0, 0, T(n, k-1)+coeff(b(n$2), x, k))
        end:
    seq(seq(T(n, k), k=0..n), n=0..10);  # Alois P. Heinz, Mar 13 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_] := T[n, k] = If[k < 0, 0, T[n, k-1] + Coefficient[b[n, n], x, k]];
    Table[Table[T[n, k], {k, 0, n}], {n, 0, 10}] // Flatten (* Jean-François Alcover, Mar 21 2025, after Alois P. Heinz *)
  • Python
    from sympy import binomial
    from sympy.utilities.iterables import partitions
    from sympy.combinatorics.partitions import IntegerPartition
    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):
            p = IntegerPartition( p).as_dict()
            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
        for i in range( n - 1):
            t[i+1] += t[i]
        return [0] + t

Formula

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

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

Original entry on oeis.org

1, 0, 4, 0, 6, 16, 0, 8, 32, 52, 0, 10, 63, 123, 158, 0, 12, 100, 264, 384, 440, 0, 14, 158, 506, 876, 1086, 1170, 0, 16, 224, 896, 1800, 2500, 2836, 2956, 0, 18, 317, 1491, 3489, 5359, 6542, 7046, 7211, 0, 20, 420, 2372, 6324, 10848, 14208, 16056, 16776, 16996
Offset: 0

Views

Author

Peter Dolland, Apr 24 2025

Keywords

Examples

			Triangle starts:
 0 : [1]
 1 : [0,  4]
 2 : [0,  6,  16]
 3 : [0,  8,  32,   52]
 4 : [0, 10,  63,  123,   158]
 5 : [0, 12, 100,  264,   384,   440]
 6 : [0, 14, 158,  506,   876,  1086,  1170]
 7 : [0, 16, 224,  896,  1800,  2500,  2836,  2956]
 8 : [0, 18, 317, 1491,  3489,  5359,  6542,  7046,  7211]
 9 : [0, 20, 420, 2372,  6324, 10848, 14208, 16056, 16776, 16996]
10 : [0, 22, 556, 3608, 11002, 20836, 29488, 34976, 37700, 38690, 38976]
...
		

Crossrefs

Row sums of A383351.
Cf. A381895 (1-color), A381891 (1-kind), A026820 (1-color, 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
        for i in range(n - 1):
            t[i + 1] += t[i]
        return [0] + t

Formula

T(n,k) = Sum_{i=0..k} A383351(n,i).
T(n,1) = 2*n + 2 for n >= 1.

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

Original entry on oeis.org

1, 0, 4, 0, 10, 20, 0, 20, 60, 80, 0, 35, 170, 270, 305, 0, 56, 396, 816, 1016, 1072, 0, 84, 868, 2238, 3188, 3538, 3622, 0, 120, 1716, 5616, 9196, 10996, 11556, 11676, 0, 165, 3235, 13140, 24975, 32400, 35445, 36285, 36450, 0, 220, 5720, 28900, 63680, 90700, 104060, 108820, 110020, 110240
Offset: 0

Views

Author

Peter Dolland, Mar 19 2025

Keywords

Comments

Two unrestricted unary predicates on the n objects mean four colors: The intersection, the both differences, and the complement of the union.
The 1-color case is Euler's table A026820.
The 2-color case is A381891.
The 3-color case is A382045.

Examples

			Triangle starts:
 0 : [1]
 1 : [0,   4]
 2 : [0,  10,   20]
 3 : [0,  20,   60,    80]
 4 : [0,  35,  170,   270,    305]
 5 : [0,  56,  396,   816,   1016,   1072]
 6 : [0,  84,  868,  2238,   3188,   3538,   3622]
 7 : [0, 120, 1716,  5616,   9196,  10996,  11556,  11676]
 8 : [0, 165, 3235, 13140,  24975,  32400,  35445,  36285,  36450]
 9 : [0, 220, 5720, 28900,  63680,  90700, 104060, 108820, 110020, 110240]
10 : [0, 286, 9752, 60232, 154262, 242254, 294140, 315980, 323000, 324650, 324936]
...
		

Crossrefs

Main diagonal gives A255050.

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:= proc(n, k) option remember;
         `if`(k<0, 0, T(n, k-1)+coeff(b(n$2), x, k))
        end:
    seq(seq(T(n, k), k=0..n), n=0..10);  # Alois P. Heinz, Mar 19 2025
  • Python
    from sympy import binomial
    from sympy.utilities.iterables import partitions
    from sympy.combinatorics.partitions import IntegerPartition
    colors = 4 - 1   # the number of colors - 1
    def a382241_row( n):
        if n == 0 : return [1]
        t = list( [0] * n)
        for p in partitions( n):
            p = IntegerPartition( p).as_dict()
            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
        for i in range( n - 1):
            t[i+1] += t[i]
        return [0] + t

Formula

T(n,1) = binomial(n + 3, 3) = A000292(n + 1) for n >= 1.

A383353 Square array A(n,k), n>=0, k>=0, read by antidiagonals downwards, where n 2-colored objects are distributed into k containers of two kinds. Containers may be left empty.

Original entry on oeis.org

1, 2, 0, 3, 4, 0, 4, 8, 6, 0, 5, 12, 22, 8, 0, 6, 16, 38, 40, 10, 0, 7, 20, 54, 92, 73, 12, 0, 8, 24, 70, 144, 196, 112, 14, 0, 9, 28, 86, 196, 354, 376, 172, 16, 0, 10, 32, 102, 248, 512, 760, 678, 240, 18, 0, 11, 36, 118, 300, 670, 1200, 1554, 1136, 335, 20, 0
Offset: 0

Views

Author

Peter Dolland, Apr 24 2025

Keywords

Examples

			Array starts:
 0 : [1,  2,   3,    4,     5,     6,     7,      8,      9,     10,     11, ...]
 1 : [0,  4,   8,   12,    16,    20,    24,     28,     32,     36,     40, ...]
 2 : [0,  6,  22,   38,    54,    70,    86,    102,    118,    134,    150, ...]
 3 : [0,  8,  40,   92,   144,   196,   248,    300,    352,    404,    456, ...]
 4 : [0, 10,  73,  196,   354,   512,   670,    828,    986,   1144,   1302, ...]
 5 : [0, 12, 112,  376,   760,  1200,  1640,   2080,   2520,   2960,   3400, ...]
 6 : [0, 14, 172,  678,  1554,  2640,  3810,   4980,   6150,   7320,   8490, ...]
 7 : [0, 16, 240, 1136,  2936,  5436,  8272,  11228,  14184,  17140,  20096, ...]
 8 : [0, 18, 335, 1826,  5315, 10674, 17216,  24262,  31473,  38684,  45895, ...]
 9 : [0, 20, 440, 2812,  9136, 19984, 34192,  50248,  67024,  84020, 101016, ...]
10 : [0, 22, 578, 4186, 15188, 36024, 65512, 100488, 138188, 176878, 215854, ...]
...
		

Crossrefs

Antidiagonal sums give A161870.
Cf. A382345 (1-color), A381891 (1-kind), A026820 (1-color, 1-kind).
Cf. A278710.

Programs

  • Maple
    b:= proc(n, i) option remember; expand(`if`(n=0 or i=1, (n+1)*x^n,
          add(b(n-i*j, min(n-i*j, i-1))*binomial(i+j, j)*x^j, j=0..n/i)))
        end:
    g:= proc(n, k) option remember;
          `if`(k<0, 0, g(n, k-1)+coeff(b(n$2), x, k))
        end:
    A:= (n, k)-> add(add(g(j, h)*g(n-j, k-h), h=0..k), j=0..n):
    seq(seq(A(n, d-n), n=0..d), d=0..10);  # Alois P. Heinz, May 05 2025
  • 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 a_row( n, length=11):
        if n == 0 : return [ k + 1 for k in range( length) ]
        t = list( [0] * length)
        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
        t = [0] + t
        for i in range( 1, length):
            t[i+1] += t[i] * 2 - t[i - 1]
        return t

Formula

A(0,k) = k + 1.
A(1,k) = 4*k.
A(2,k+1) = 6 + 16 * k.
A(n,1) = 2 + 2 * n.
A(n,n+k) = A(n,n) + k * A383352(n,n).
A(n,k) = Sum_{i=0..k} (k + 1 - i) * A383351(n,i) for 0 <= k <= n.
Sum_{k=0..n} (-1)^k*T(n-k,k) = A278710(n). - Alois P. Heinz, May 05 2025
Showing 1-5 of 5 results.