That works to give me the exact number of summands I'm looking for but it give me repeat summands. I get the idea behind the subroutine but I'm not sure how to change it so that it gives only partitions with distinct summands. I tried tinkering with the truth values & the != etc but it didn't seem to do the trick.