login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A257661
Number of n X n upper triangular matrices (m_{i,j}) of nonnegative integers with (Sum_{j=h..n} m_{h,j} - Sum_{i=1..h-1} m_{i,h}) in {-1,+1} for all h in {1,...,n}.
1
1, 1, 3, 13, 91, 957, 14883, 335685, 10809115, 489983429, 30878036187, 2674610665285, 315157973368499, 50044685318592821, 10616892819871806779, 2985356872553448786917, 1104511676749585428665683, 534037023412133157982099237, 335321015907953576212969151451
OFFSET
0,3
LINKS
EXAMPLE
a(2) = 3: [1,0; 0,1], [0,1; 0,0], [0,1; 0,2].
MAPLE
b:= proc(n, i, l) option remember; (m-> `if`(m=0, 1,
`if`(i=0, b(l[1]+1, m-1, subsop(1=NULL, l))+
`if`(l[1]=0, 0, b(l[1]-1, m-1, subsop(1=NULL, l))),
add(b(n-j, i-1, subsop(i=l[i]+j, l)), j=0..n))))(nops(l))
end:
a:= n-> b(1, n-1, [0$(n-1)]):
seq(a(n), n=0..14);
MATHEMATICA
b[n_, i_, l_] := b[n, i, l] = With[{m = Length[l]}, If[m == 0, 1, If[i == 0, b[l[[1]] + 1, m - 1, ReplacePart[l, 1 -> Nothing]] + If[l[[1]] == 0, 0, b[l[[1]] - 1, m - 1, ReplacePart[l, 1 -> Nothing]]], Sum[b[n - j, i - 1, ReplacePart[l, i -> l[[i]] + j]], {j, 0, n}]]]];
a[n_] := b[1, n - 1, Table[0, {n - 1}]];
Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Nov 18 2023, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A116434 A174290 A034513 * A292501 A243243 A274052
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jul 12 2015
STATUS
approved