login
A224344
Number T(n,k) of compositions of n using exactly k primes (counted with multiplicity); triangle T(n,k), n>=0, 0<=k<=floor(n/2), read by rows.
6
1, 1, 1, 1, 1, 3, 2, 5, 1, 3, 8, 5, 5, 13, 13, 1, 7, 23, 27, 7, 11, 39, 52, 25, 1, 17, 65, 99, 66, 9, 27, 106, 186, 151, 41, 1, 40, 177, 340, 323, 133, 11, 61, 293, 608, 666, 358, 61, 1, 92, 482, 1076, 1330, 867, 236, 13, 142, 781, 1894, 2581, 1971, 737, 85, 1
OFFSET
0,6
LINKS
FORMULA
Sum_{k=1..floor(n/2)} k * T(n,k) = A102291(n).
EXAMPLE
A(5,1) = 8: [2,1,1,1], [1,2,1,1], [1,1,2,1], [1,1,1,2], [3,1,1], [1,3,1], [1,1,3], [5].
Triangle T(n,k) begins:
1;
1;
1, 1;
1, 3;
2, 5, 1;
3, 8, 5;
5, 13, 13, 1;
7, 23, 27, 7;
11, 39, 52, 25, 1;
17, 65, 99, 66, 9;
27, 106, 186, 151, 41, 1;
40, 177, 340, 323, 133, 11;
...
MAPLE
T:= proc(n) option remember; local j; if n=0 then 1
else []; for j to n do zip((x, y)->x+y, %,
[`if`(isprime(j), 0, NULL), T(n-j)], 0) od; %[] fi
end:
seq(T(n), n=0..16);
MATHEMATICA
zip[f_, x_List, y_List, z_] := With[{m = Max[Length[x], Length[y]]}, Thread[f[PadRight[x, m, z], PadRight[y, m, z]]]]; T[n_] := T[n] = Module[{j, pc}, If[n == 0, {1}, pc = {}; For[j = 1, j <= n, j++, pc = zip[Plus, pc, Join[If[PrimeQ[j], {0}, {}], T[n-j]], 0]]; pc]]; Table[T[n], {n, 0, 16}] // Flatten (* Jean-François Alcover, Jan 29 2014, after Alois P. Heinz *)
CROSSREFS
Column k=0 gives: A052284.
Row sums are: A011782.
Row lengths are: A008619.
T(floor(n/2)) = A093178(n).
T(2n,n-1) = A001844(n-1) for n>0.
Sequence in context: A121490 A197293 A099643 * A113260 A051543 A265574
KEYWORD
nonn,tabf
AUTHOR
Alois P. Heinz, May 23 2013
STATUS
approved