Problem: Given a number $n,$ we want to find out the subsets of $\{1,2,\ldots,n\}$ that add up to the given number $n.$
Example: If $n=6,$ then the output is: $\{1,5\}, \{2,4\}, \{1,2,3\}.$
Can anyone suggest a program for this?
Problem: Given a number $n,$ we want to find out the subsets of $\{1,2,\ldots,n\}$ that add up to the given number $n.$
Example: If $n=6,$ then the output is: $\{1,5\}, \{2,4\}, \{1,2,3\}.$
Can anyone suggest a program for this?