next_integer_partition

mathtools.next_integer_partition(integer_partition)

Next integer partition following integer_partition in descending lex order.

>>> mathtools.next_integer_partition((8, 3))
(8, 2, 1)
>>> mathtools.next_integer_partition((8, 2, 1))
(8, 1, 1, 1)
>>> mathtools.next_integer_partition((8, 1, 1, 1))
(7, 4)

Input integer_partition must be sequence of positive integers.

Returns integer partition as tuple of positive integers.