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.

This page as a plain text file.
%I A382041 #12 Mar 19 2025 10:39:55
%S A382041 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,
%T A382041 350,490,574,0,4,52,236,556,896,1120,1240,0,4,62,310,845,1505,2079,
%U A382041 2415,2580,0,4,68,400,1200,2400,3584,4480,4960,5180,0,4,78,494,1670,3626,5910,7842,9162,9822,10108
%N 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.
%C A382041 Two unrestricted unary predicates on the parts set result in four kinds: The intersection, the both differences and the complement of the union.
%C A382041 The 1-kind case is Euler's table A026820.
%C A382041 The 2-kind case is A381895.
%C A382041 The 3-kind case is A382025.
%e A382041 Triangle starts:
%e A382041   0 : [1]
%e A382041   1 : [0, 4]
%e A382041   2 : [0, 4, 14]
%e A382041   3 : [0, 4, 20,  40]
%e A382041   4 : [0, 4, 30,  70,  105]
%e A382041   5 : [0, 4, 36, 116,  196,  252]
%e A382041   6 : [0, 4, 46, 170,  350,  490,  574]
%e A382041   7 : [0, 4, 52, 236,  556,  896, 1120, 1240]
%e A382041   8 : [0, 4, 62, 310,  845, 1505, 2079, 2415, 2580]
%e A382041   9 : [0, 4, 68, 400, 1200, 2400, 3584, 4480, 4960, 5180]
%e A382041  10 : [0, 4, 78, 494, 1670, 3626, 5910, 7842, 9162, 9822, 10108]
%e A382041  ...
%o A382041 (Python)
%o A382041 from sympy import binomial
%o A382041 from sympy.utilities.iterables import partitions
%o A382041 from sympy.combinatorics.partitions import IntegerPartition
%o A382041 kinds = 4 - 1   # the number of part kinds - 1
%o A382041 def a382041_row( n):
%o A382041     if n == 0 : return [1]
%o A382041     t = list( [0] * n)
%o A382041     for p in partitions( n):
%o A382041         p = IntegerPartition( p).as_dict()
%o A382041         fact = 1
%o A382041         s = 0
%o A382041         for k in p :
%o A382041             s += p[k]
%o A382041             fact *= binomial( kinds + p[k], kinds)
%o A382041         if s > 0 :
%o A382041             t[s - 1] += fact
%o A382041     for i in range( n - 1):
%o A382041         t[i+1] += t[i]
%o A382041     return [0] + t
%Y A382041 Main diagonal gives A023003.
%Y A382041 Cf. A026820, A381895, A382025.
%K A382041 nonn,tabl
%O A382041 0,3
%A A382041 _Peter Dolland_, Mar 12 2025