Function to calculate the number of partitions with k groups of sizes between smin and smax
Useful links