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.

This page as a plain text file.
%I A383351 #9 May 01 2025 18:42:46
%S A383351 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,
%T A383351 370,210,84,0,16,208,672,904,700,336,120,0,18,299,1174,1998,1870,1183,
%U A383351 504,165,0,20,400,1952,3952,4524,3360,1848,720,220
%N 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.
%F A383351 T(n,n) = binomial(n + 3, 3) = A000292(n + 1).
%F A383351 T(n,1) = 2*n + 2 for n >= 1.
%F A383351 T(n,k+1) = A383352(n,k+1) - A383352(n,k) for 0 <= k < n.
%e A383351 Triangle starts:
%e A383351  0 : [1]
%e A383351  1 : [0,  4]
%e A383351  2 : [0,  6,  10]
%e A383351  3 : [0,  8,  24,   20]
%e A383351  4 : [0, 10,  53,   60,   35]
%e A383351  5 : [0, 12,  88,  164,  120,   56]
%e A383351  6 : [0, 14, 144,  348,  370,  210,   84]
%e A383351  7 : [0, 16, 208,  672,  904,  700,  336,  120]
%e A383351  8 : [0, 18, 299, 1174, 1998, 1870, 1183,  504,  165]
%e A383351  9 : [0, 20, 400, 1952, 3952, 4524, 3360, 1848,  720, 220]
%e A383351 10 : [0, 22, 534, 3052, 7394, 9834, 8652, 5488, 2724, 990, 286]
%e A383351 ...
%o A383351 (Python)
%o A383351 from sympy import binomial
%o A383351 from sympy.utilities.iterables import partitions
%o A383351 def calc_w(k , m):
%o A383351     s = 0
%o A383351     for p in partitions(m, m=k+1):
%o A383351         fact = 1
%o A383351         j = k + 1
%o A383351         for x in p :
%o A383351             fact *= binomial(j, p[x]) * (x + 1) ** p[x]
%o A383351             j -= p[x]
%o A383351         s += fact
%o A383351     return s
%o A383351 def t_row(n):
%o A383351     if n == 0 : return [1]
%o A383351     t = list([0] * n)
%o A383351     for p in partitions( n):
%o A383351         fact = 1
%o A383351         s = 0
%o A383351         for k in p :
%o A383351             s += p[k]
%o A383351             fact *= calc_w(k, p[k])
%o A383351         if s > 0 :
%o A383351             t[s - 1] += fact
%o A383351     return [0] + t
%Y A383351 Main diagonal gives A000292(n+1).
%Y A383351 Partial row sums are A383352.
%Y A383351 Cf. A382342 (1-colored), A382339 (1-kind), A008284 (1-colored, 1-kind).
%K A383351 nonn,tabl
%O A383351 0,3
%A A383351 _Peter Dolland_, Apr 24 2025