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.

A381891 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 with 0 <= k <= n.

Original entry on oeis.org

1, 0, 2, 0, 3, 6, 0, 4, 10, 14, 0, 5, 19, 28, 33, 0, 6, 28, 52, 64, 70, 0, 7, 44, 93, 127, 142, 149, 0, 8, 60, 152, 228, 272, 290, 298, 0, 9, 85, 242, 404, 507, 561, 582, 591, 0, 10, 110, 370, 672, 904, 1034, 1098, 1122, 1132, 0, 11, 146, 546, 1100, 1568, 1870, 2027, 2101, 2128, 2139
Offset: 0

Views

Author

Peter Dolland, Mar 09 2025

Keywords

Comments

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

Examples

			Triangle begins:
  1;
  0, 2;
  0, 3,  6;
  0, 4, 10,  14;
  0, 5, 19,  28,  33;
  0, 6, 28,  52,  64,  70;
  0, 7, 44,  93, 127, 142, 149;
  0, 8, 60, 152, 228, 272, 290, 298;
  ...
		

Crossrefs

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:= 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 09 2025
  • Python
    from sympy import binomial
    from sympy.utilities.iterables import partitions
    from sympy.combinatorics.partitions import IntegerPartition
    def a381891_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( k + p[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(1,k) = k + 1.
T(n,n) = A005380(n).