in reply to Re^4: Obtaining terms in an expansion
in thread Obtaining terms in an expansion

The 2**N doesn't need to be computed anyway. next_multiset() will just keep returning each possible set until all have been returned, at which point it returns undef().

Everything but the troll