Non-recursive implementation of count_partitions()