OFFSET
0,6
LINKS
Alois P. Heinz, Rows n = 0..200, flattened
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
KEYWORD
nonn,tabf
AUTHOR
Alois P. Heinz, May 23 2013
STATUS
approved