Michael Robertson: > I'm guessing sage has this, but shouldn't something like this be part of > the standard library (perhaps in C)? My answer is positive. As a reference point you can look at the combinatorics module of Mathematica. Bye, bearophile