Text this: Efficient calculation of the number of partitions of the set into subsets satisfying