2 ms·
if interested in integer partitions this python should do the job def intpart(n): if n == 0: yield [] for k in range(1,n+1): for p
by kurtosis 18y ago
if interested in integer partitions this python should do the job
def intpart(n):
if n == 0:
yield []
for k in range(1,n+1):
for p in intpart(n-k):
yield [k] + p
i believe that this isn't truly integer partitions because it will count 4 = 1,1,2,1 and 1,1,1,2 as different partitions but that's all I can give you between breakfast and work.
see wikipedia for integer partiton or young tableau for more on these interesting objects