Calculate combinations (#716)