This function generates all integer partitions of a given integer k in reverse lexicographical order.
The function is adapted from "Algorithm ZS1" described in Zoghbi and Stojmenovic (1998),
"Fast Algorithms for Generating Integer Partitions", International Journal of Computer Mathematics,
Volume 70, Issue 2, pages 319-332.