function l=minlev(u,d) % the SMALLEST level node #u can possibly occupy l = ceil(log(u*(d-1)+1)/log(d))-1; return