I randomly came across this question today, and remembered I'd written a function to do this in Haskell not too long ago.
distinctPartitions 0 = [[]] distinctPartitions n = [x:xs | x <- [1..n], xs <- distinctPartitions (n - x), null xs || x < head xs] Here's the same idea implemented in python, additionally usingmy (probably clumsy) attempt to translate this to Mathematica (with memoization):
fromdistinctPartitions[0] functools:= importdistinctPartitions[0] lru_cache @lru_cache(maxsize=None) def= distinctPartitions(n):{{}}; distinctPartitions[n_] := if ndistinctPartitions[n] === 0: Flatten[Table[ Prepend[xs, returnx], [[]] {x, 1, n}, {xs, return [[x] + xs for xSelect[distinctPartitions[n in- range(1x], n+1) for xs in distinctPartitions (n-x) if xsLength@# == []0 or|| x < xs[0]] First@# &]}], 1] My Mathematica skills are rather rusty, so I'll leave it to you to translate in case you want to try this approach - should be straightforward, hopefully.