4 ms·
Suspicion: this is because a positive integer is a linked list. Every integer is defined by a unary root element and then a series of successors until its cardi
by wwweston 4y ago
Suspicion: this is because a positive integer is a linked list. Every integer is defined by a unary root element and then a series of successors until its cardinality matches the corresponding symbol (counting is correspondence).
> find the count of subsets that sum to a particular number without actually enumerating them all.
Would the generating formula for partition numbers[0] work, or am I misunderstanding this problem?
(I think actually generating the subsets is necessarily a dynamic programming problem...)
[0] https://en.wikipedia.org/wiki/Partition_(number_theory)#:~:text=the%20generating%20function%20formula%20described%20below%3A https://en.wikipedia.org/wiki/Partition_(number_theory)#:~:t...
- btilly 4y agoYou are misunderstanding the problem. Given a particular set, the question is enumerating the subsets that add to a particular thing. The fact that numbers themselves could be represented as a linked list has nothing to do with it. And there is no particularly useful generating function to use either. For example there are 303 primes less than 2000, and 47,839,398,752,301 subsets of them add up to 2000. If you arrange them in lexicographic order, what is the 5 trillionth one?