login
Triangle read by rows: T(n,k) is the number of partitions of n having exactly k parts that are multiple of 3 (n>=0, 0<=k<=floor(n/3)).
3

%I #11 Nov 01 2015 15:09:03

%S 1,1,2,2,1,4,1,5,2,7,3,1,9,5,1,13,7,2,16,10,3,1,22,14,5,1,27,20,7,2,

%T 36,26,11,3,1,44,36,15,5,1,57,47,22,7,2,70,62,29,11,3,1,89,80,41,15,5,

%U 1,108,104,54,22,7,2,135,132,73,30,11,3,1,163,169,95,42,15,5,1,202,212

%N Triangle read by rows: T(n,k) is the number of partitions of n having exactly k parts that are multiple of 3 (n>=0, 0<=k<=floor(n/3)).

%C Row n has 1+floor(n/3) terms. Row sums yield the partition numbers (A000041). T(n,0)=A000726(n). T(n,1)=A116634(n). Sum(k*T(n,k),k=0..floor(n/3))=A116635(n).

%H Alois P. Heinz, <a href="/A116633/b116633.txt">Rows n = 0..250, flattened</a>

%F G.f.: G(t,x) = 1/product((1-x^(3j-2))(1-x^(3j-1))(1-tx^(3j)), j=1..infinity).

%e T(9,2) = 3 because we have [6,3], [3,3,2,1] and [3,3,1,1,1].

%e Triangle starts:

%e 1;

%e 1;

%e 2;

%e 2, 1;

%e 4, 1;

%e 5, 2;

%e 7, 3, 1;

%e 9, 5, 1;

%p g:=1/product((1-x^(3*j-2))*(1-x^(3*j-1))*(1-t*x^(3*j)),j=1..20): gser:=simplify(series(g,x=0,26)): P[0]:=1: for n from 1 to 21 do P[n]:=coeff(gser,x^n) od: for n from 1 to 21 do seq(coeff(P[n],t,j),j=0..floor(n/3)) od; # yields sequence in triangular form

%p # second Maple program:

%p b:= proc(n, i) option remember; local j; if n=0 then 1 elif i<1

%p then 0 else []; for j from 0 to n/i do zip((x, y)->x+y, %,

%p [`if`(irem(i, 3)=0, 0$j, [][]), b(n-i*j, i-1)], 0) od; %[] fi

%p end:

%p T:= n-> b(n, n):

%p seq(T(n), n=0..30); # _Alois P. Heinz_, Jan 08 2013

%t b[n_, i_] := b[n, i] = Module[{j}, If[n == 0, {1}, If[i<1, {0}, pc = {}; For[j = 0, j <= n/i, j++, pc = Plus @@ PadRight[{pc, If[Mod[i, 3] == 0, Array[0&, j], {}] ~Join~ b[n-i*j, i-1]}]]]; pc]]; T[n_] := b[n, n]; Table[T[n], {n, 0, 30}] // Flatten (* _Jean-François Alcover_, Jan 31 2014, after _Alois P. Heinz_ *)

%Y Cf. A000041, A000726, A116634, A116635.

%K nonn,tabf

%O 0,3

%A _Emeric Deutsch_, Feb 19 2006