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”).

Number of n X n X n triangular 0..1 arrays with horizontal row sums nondecreasing from top to bottom.
1

%I #54 Feb 28 2017 22:55:21

%S 1,2,7,44,507,10868,437908,33421356,4860115569,1353020399536,

%T 723897398723818,746732196670027756,1489203154941738419275,

%U 5755222920272113115716592,43188989125323730167491656884,630465046596547626339663980200440

%N Number of n X n X n triangular 0..1 arrays with horizontal row sums nondecreasing from top to bottom.

%C With increasing sums we get A003422(n+1). - _Alois P. Heinz_, Dec 02 2016

%C With nondecreasing row elements we get A000108(n+1). - _Alois P. Heinz_, Dec 04 2016

%H Alois P. Heinz, <a href="/A278295/b278295.txt">Table of n, a(n) for n = 0..82</a>

%e Some solutions for n=3:

%e 0 0 0 0 0 0 0 0 0

%e 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0

%e 0 0 0 1 0 0 0 1 0 0 0 1 1 1 0 1 0 1 0 1 1 1 1 1 1 0 0

%p noNSumR := proc(n,s)

%p binomial(n,s) ;

%p end proc:

%p A278295 := proc(n)

%p local a,mtot,p,pa,weakp,c,i ;

%p a := 0 ;

%p mtot := n*(n+1)/2 ;

%p for p from 0 to mtot do

%p for pa in combinat[partition](p+n) do

%p if nops(pa) = n then

%p weakp := [seq(op(i,pa)-1,i=1..nops(pa))] ;

%p c := 1 ;

%p for i from 1 to nops(weakp) do

%p c := c*noNSumR(i,op(i,weakp)) ;

%p end do:

%p a := a+c ;

%p end if;

%p end do:

%p end do:

%p a;

%p end proc: # _R. J. Mathar_, Dec 02 2016

%p # second Maple program:

%p b:= proc(n, i, k) option remember; `if`(i>n, 1,

%p add(binomial(i, j)*b(n, i+1, j), j=k..i))

%p end:

%p a:= n-> b(n, 0$2):

%p seq(a(n), n=0..20); # _Alois P. Heinz_, Dec 02 2016

%t b[n_, i_, k_] := b[n, i, k] = If[i>n, 1, Sum[Binomial[i, j]*b[n, i+1, j], {j, k, i}]]; a[n_] := b[n, 0, 0]; Table[a[n], {n, 0, 20}] (* _Jean-François Alcover_, Feb 28 2017, after _Alois P. Heinz_ *)

%o (PARI) rowsum(rowarr) = sum(x=1, #rowarr, rowarr[x])

%o is_validcombination(toprow, bottomrow) = if(rowsum(bottomrow) < rowsum(toprow), return(0), return(1))

%o nextrowcomb(rowarr) = my(k=#rowarr, i=0); while(rowarr[k]==1, rowarr[k]=0; i++; k--); while(rowarr[k]==0 && k > 1, k--); if(rowarr[k]==1, rowarr[k]=0; rowarr[k+1]=1; k=k+2; while(i > 0, rowarr[k]=1; k++; i--), for(x=k, k+i, rowarr[x]=1)); rowarr

%o terms(n) = my(toprows=[[0], [1]], bottomrow=[0, 0], validrows=[]); while(1, for(k=1, #toprows, if(is_validcombination(toprows[k], bottomrow), validrows=concat(validrows, [bottomrow]))); if(vecmin(bottomrow)==1, bottomrow=vector(#bottomrow+1); print1(#validrows, ", "); toprows=validrows; validrows=[], bottomrow=nextrowcomb(bottomrow)); if(#bottomrow==n+2, break))

%o terms(4) \\ print initial four terms

%Y Cf. A000108, A003422, A256369.

%K nonn

%O 0,2

%A _Felix Fröhlich_, Nov 30 2016

%E 4 more terms from _R. J. Mathar_, Dec 02 2016

%E a(0), a(10)-a(15) from _Alois P. Heinz_, Dec 02 2016