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.

A144643 Triangle read by rows: T(n,k) = number of partitions of [1..k] into n nonempty clumps of sizes 1, 2, 3 or 4 (n >= 0, 0 <= k <= 4n).

This page as a plain text file.
%I A144643 #22 Jun 09 2025 04:41:05
%S A144643 1,0,1,1,1,1,0,0,1,3,7,15,25,35,35,0,0,0,1,6,25,90,280,770,1855,3675,
%T A144643 5775,5775,0,0,0,0,1,10,65,350,1645,6930,26425,90475,275275,725725,
%U A144643 1576575,2627625,2627625,0,0,0,0,0,1,15,140,1050,6825,39795,211750,1033725,4629625
%N A144643 Triangle read by rows: T(n,k) = number of partitions of [1..k] into n nonempty clumps of sizes 1, 2, 3 or 4 (n >= 0, 0 <= k <= 4n).
%H A144643 G. C. Greubel, <a href="/A144643/b144643.txt">Rows n = 0..25 of the irregular triangle, flattened</a>
%H A144643 Moa Apagodu, David Applegate, N. J. A. Sloane, and Doron Zeilberger, <a href="http://arxiv.org/abs/1701.08394">Analysis of the Gift Exchange Problem</a>, arXiv:1701.08394 [math.CO], 2017.
%H A144643 David Applegate and N. J. A. Sloane, <a href="http://arxiv.org/abs/0907.0513">The Gift Exchange Problem</a>, arXiv:0907.0513 [math.CO], 2009.
%F A144643 T(n, k) = Sum_{j=0..3} binomial(k-1, j) * T(n-1, k-j-1), with T(n, n) = 1, T(n, k) = 0 if n < 1 or n > k.
%F A144643 Sum_{k=0..4*n} T(n, k) = A144508(n).
%e A144643 Irregular triangle begins:
%e A144643   1;
%e A144643   0, 1, 1, 1, 1;
%e A144643   0, 0, 1, 3, 7, 15, 25,  35,  35;
%e A144643   0, 0, 0, 1, 6, 25, 90, 280, 770, 1855, 3675, 5775, 5775;
%e A144643   ...
%p A144643 T := proc(n, k) option remember;
%p A144643 if n = k then 1;
%p A144643 elif k < n then 0;
%p A144643 elif n < 1 then 0;
%p A144643 else T(n - 1, k - 1) + (k - 1)*T(n - 1, k - 2) + 1/2*(k - 1)*(k - 2)*T(n - 1, k - 3) + 1/6*(k - 1)*(k - 2)*(k - 3)*T(n - 1, k - 4);
%p A144643 end if;
%p A144643 end proc;
%t A144643 T[n_, k_]:= T[n, k]= Which[n==k, 1, k<n, 0, n<1, 0, True, T[n-1, k-1] + (k-1)*T[n-1, k-2] + 1/2*(k-1)*(k-2)*T[n-1, k-3] + 1/6*(k-1)*(k-2)*(k-3)*T[n-1, k-4]]; Table[T[n, k], {n, 0, 5}, {k, 0, 4n}]//Flatten (* _Jean-François Alcover_, Mar 20 2014, after Maple *)
%t A144643 Table[BellY[k, n, {1,1,1,1}], {n,0,12}, {k,0,4*n}]//Flatten (* _G. C. Greubel_, Oct 11 2023 *)
%o A144643 (Magma)
%o A144643 function t(n,k)
%o A144643   if k eq n then return 1;
%o A144643   elif k le n-1 or n le 0 then return 0;
%o A144643   else return (&+[Binomial(k-1,j)*t(n-1,k-j-1): j in [0..3]]);
%o A144643   end if;
%o A144643 end function;
%o A144643 A144643:= func< n,k | t(n,k) >;
%o A144643 [A144643(n,k): k in [0..4*n], n in [0..8]]; // _G. C. Greubel_, Oct 11 2023
%o A144643 (SageMath)
%o A144643 @CachedFunction
%o A144643 def t(n,k):
%o A144643     if (k==n): return 1
%o A144643     elif (k<n or n<1): return 0
%o A144643     else: return sum(binomial(k-1,j)*t(n-1,k-j-1) for j in range(4))
%o A144643 def A144643(n,k): return t(n,k)
%o A144643 flatten([[A144643(n,k) for k in range(4*n+1)] for n in range(13)]) # _G. C. Greubel_, Oct 11 2023
%Y A144643 Row sums give A144508.
%Y A144643 See A144644 and A144645 for other versions.
%Y A144643 Cf. A144299, A144385.
%K A144643 nonn,tabf
%O A144643 0,10
%A A144643 _David Applegate_ and _N. J. A. Sloane_, Jan 25 2009