OFFSET
1,5
COMMENTS
LINKS
Alois P. Heinz, Rows n = 1..26, flattened
EXAMPLE
Triangle begins:
1;
1, 1;
1, 3, 1;
1, 3, 4, 3, 1;
1, 3, 4, 5, 4, 3, 1;
1, 3, 4, 5, 4, 6, 5, 4, 4, 3, 1;
1, 3, 4, 5, 4, 6, 7, 6, 6, 6, 5, 4, 4, 3, 1;
1, 3, 4, 5, 4, 6, 7, 4, 6, 6, 8, 7, 8, 6, 6, 6, 5, 4, 4, 4, 3, 1;
MAPLE
h:= proc(l) local ll; ll:= [seq(add(
`if`(l[j]>=i, 1, 0), j=1..nops(l)), i=1..l[1])];
add(min(l[i], ll[i]), i=1..min(nops(l), nops(ll)))
end:
g:= (n, i, l)-> `if`(n=0 or i=1, [h([l[], 1$n])],
[`if`(i>n, [], g(n-i, i, [l[], i]))[], g(n, i-1, l)[]]):
T:= n-> g(n, n, [])[]:
seq(T(n), n=1..10); # Alois P. Heinz, Dec 14 2012
MATHEMATICA
h[l_List] := Module[{ll}, ll = Flatten[Table[Sum[If[l[[j]] >= i, 1, 0], {j, 1, Length[l]}], {i, 1, l[[1]]}]]; Sum[Min[l[[i]], ll[[i]]], {i, 1, Min[ Length[l], Length[ll]]}]]; g[n_, i_, l_List] := If[n==0 || i==1, Join[ {h[Join[l, Array[1&, n]]]}], Join[If[i>n, {}, g[n-i, i, Join [l, {i}]]], g[n, i-1, l]]]; T[n_] := g[n, n, {}]; Table[T[n], {n, 1, 10}] // Flatten (* Jean-François Alcover, Dec 23 2015, after Alois P. Heinz *)
CROSSREFS
KEYWORD
AUTHOR
Olivier Gérard, Nov 08 2012
STATUS
approved