login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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). 7

%I #18 Oct 13 2023 07:36:49

%S 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 5775,5775,0,0,0,0,1,10,65,350,1645,6930,26425,90475,275275,725725,

%U 1576575,2627625,2627625,0,0,0,0,0,1,15,140,1050,6825,39795,211750,1033725,4629625

%N 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 G. C. Greubel, <a href="/A144643/b144643.txt">Rows n = 0..25 of the irregular triangle, flattened</a>

%H 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 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 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 Sum_{k=0..4*n} T(n, k) = A144508(n).

%e Irregular triangle begins:

%e 1;

%e 0, 1, 1, 1, 1;

%e 0, 0, 1, 3, 7, 15, 25, 35, 35;

%e 0, 0, 0, 1, 6, 25, 90, 280, 770, 1855, 3675, 5775, 5775;

%e ...

%p T := proc(n, k) option remember;

%p if n = k then 1;

%p elif k < n then 0;

%p elif n < 1 then 0;

%p 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 end if;

%p end proc;

%t 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 Table[BellY[k, n, {1,1,1,1}], {n,0,12}, {k,0,4*n}]]//Flatten (* _G. C. Greubel_, Oct 11 2023 *)

%o (Magma)

%o function t(n,k)

%o if k eq n then return 1;

%o elif k le n-1 or n le 0 then return 0;

%o else return (&+[Binomial(k-1,j)*t(n-1,k-j-1): j in [0..3]]);

%o end if;

%o end function;

%o A144643:= func< n,k | t(n,k) >;

%o [A144643(n,k): k in [0..4*n], n in [0..8]]; // _G. C. Greubel_, Oct 11 2023

%o (SageMath)

%o @CachedFunction

%o def t(n,k):

%o if (k==n): return 1

%o elif (k<n or n<1): return 0

%o else: return sum(binomial(k-1,j)*t(n-1,k-j-1) for j in range(4))

%o def A144643(n,k): return t(n,k)

%o flatten([[A144643(n,k) for k in range(4*n+1)] for n in range(13)]) # _G. C. Greubel_, Oct 11 2023

%Y Row sums give A144508.

%Y See A144644 and A144645 for other versions.

%Y Cf. A144299, A144385.

%K nonn,tabf

%O 0,10

%A _David Applegate_ and _N. J. A. Sloane_, Jan 25 2009

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 19:06 EDT 2024. Contains 371962 sequences. (Running on oeis4.)