X := proc(h,m) option remember; local n; if m=1 then if h=0 then return 0 else return 1 fi fi; n:=m-1; 1/n* add(add(X(h,q)* `if`(n-q+1 mod l =0, (n-q+1)/l*X(h-1,(n-q+1)/l), 0), q=1..n), l=1..n); end; XX := (h,m)-> X(h,m)-X(h-1,m);