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.
%I A383352 #9 May 01 2025 18:41:31 %S A383352 1,0,4,0,6,16,0,8,32,52,0,10,63,123,158,0,12,100,264,384,440,0,14,158, %T A383352 506,876,1086,1170,0,16,224,896,1800,2500,2836,2956,0,18,317,1491, %U A383352 3489,5359,6542,7046,7211,0,20,420,2372,6324,10848,14208,16056,16776,16996 %N A383352 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 where 0 <= k <= n, and each part is one of 2 kinds. %F A383352 T(n,k) = Sum_{i=0..k} A383351(n,i). %F A383352 T(n,1) = 2*n + 2 for n >= 1. %e A383352 Triangle starts: %e A383352 0 : [1] %e A383352 1 : [0, 4] %e A383352 2 : [0, 6, 16] %e A383352 3 : [0, 8, 32, 52] %e A383352 4 : [0, 10, 63, 123, 158] %e A383352 5 : [0, 12, 100, 264, 384, 440] %e A383352 6 : [0, 14, 158, 506, 876, 1086, 1170] %e A383352 7 : [0, 16, 224, 896, 1800, 2500, 2836, 2956] %e A383352 8 : [0, 18, 317, 1491, 3489, 5359, 6542, 7046, 7211] %e A383352 9 : [0, 20, 420, 2372, 6324, 10848, 14208, 16056, 16776, 16996] %e A383352 10 : [0, 22, 556, 3608, 11002, 20836, 29488, 34976, 37700, 38690, 38976] %e A383352 ... %o A383352 (Python) %o A383352 from sympy import binomial %o A383352 from sympy.utilities.iterables import partitions %o A383352 def calc_w(k , m): %o A383352 s = 0 %o A383352 for p in partitions(m, m=k+1): %o A383352 fact = 1 %o A383352 j = k + 1 %o A383352 for x in p : %o A383352 fact *= binomial(j, p[x]) * (x + 1) ** p[x] %o A383352 j -= p[x] %o A383352 s += fact %o A383352 return s %o A383352 def t_row(n): %o A383352 if n == 0 : return [1] %o A383352 t = list([0] * n) %o A383352 for p in partitions( n): %o A383352 fact = 1 %o A383352 s = 0 %o A383352 for k in p : %o A383352 s += p[k] %o A383352 fact *= calc_w(k, p[k]) %o A383352 if s > 0 : %o A383352 t[s - 1] += fact %o A383352 for i in range(n - 1): %o A383352 t[i + 1] += t[i] %o A383352 return [0] + t %Y A383352 Row sums of A383351. %Y A383352 Cf. A381895 (1-color), A381891 (1-kind), A026820 (1-color, 1-kind). %K A383352 nonn,tabl %O A383352 0,3 %A A383352 _Peter Dolland_, Apr 24 2025