some python programs to enumerate or generate partitions of n, subject to number of parts<=k and size of parts<=m.
the numbers of partitions with given contraints can often be expressed as a recurrence relation. so one way to count or list such partitions is by recursive routines that exploit the recurrence relation. recursive routines, while being elegant, are often wasteful of time and memory. time can be saved by dynamic programming (at the cost of memory and elegance).
an alternative to recursion is to first compute (by iteration) tables of values from the recurrence formulae and then use the tables to solve the problem. this is the methodology used here. although compiling the tables is costly, it can still be worth it when there is much number crunching to follow.