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.

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.