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.

A382041 Triangle read by rows: T(n, k) is the number of partitions of n with at most k parts where 0 <= k <= n, and each part is one of four kinds.

Original entry on oeis.org

1, 0, 4, 0, 4, 14, 0, 4, 20, 40, 0, 4, 30, 70, 105, 0, 4, 36, 116, 196, 252, 0, 4, 46, 170, 350, 490, 574, 0, 4, 52, 236, 556, 896, 1120, 1240, 0, 4, 62, 310, 845, 1505, 2079, 2415, 2580, 0, 4, 68, 400, 1200, 2400, 3584, 4480, 4960, 5180, 0, 4, 78, 494, 1670, 3626, 5910, 7842, 9162, 9822, 10108
Offset: 0

Views

Author

Peter Dolland, Mar 12 2025

Keywords

Comments

Two unrestricted unary predicates on the parts set result in four kinds: The intersection, the both differences and the complement of the union.
The 1-kind case is Euler's table A026820.
The 2-kind case is A381895.
The 3-kind case is A382025.

Examples

			Triangle starts:
  0 : [1]
  1 : [0, 4]
  2 : [0, 4, 14]
  3 : [0, 4, 20,  40]
  4 : [0, 4, 30,  70,  105]
  5 : [0, 4, 36, 116,  196,  252]
  6 : [0, 4, 46, 170,  350,  490,  574]
  7 : [0, 4, 52, 236,  556,  896, 1120, 1240]
  8 : [0, 4, 62, 310,  845, 1505, 2079, 2415, 2580]
  9 : [0, 4, 68, 400, 1200, 2400, 3584, 4480, 4960, 5180]
 10 : [0, 4, 78, 494, 1670, 3626, 5910, 7842, 9162, 9822, 10108]
 ...
		

Crossrefs

Main diagonal gives A023003.

Programs

  • Python
    from sympy import binomial
    from sympy.utilities.iterables import partitions
    from sympy.combinatorics.partitions import IntegerPartition
    kinds = 4 - 1   # the number of part kinds - 1
    def a382041_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( kinds + p[k], kinds)
            if s > 0 :
                t[s - 1] += fact
        for i in range( n - 1):
            t[i+1] += t[i]
        return [0] + t