This package has the numerical::partition(const int x,const int n,const int i) function for partitioning an integer.