<t>Vanubis1,yes, this seems to me works (though your n3 got inverted). it goes as n3(n1,B)<=n3(n1,1)<=n3(N+1,1). for the last step, the turning point of the function of n1 is when n1~n2, so the other ascending half is just the mirroring that can be removed by imposing the constraint of n1<n2.in my e...