I have been thinking about this problem for a while but have been unable to formalize a complete answer.
Given an integer $n \geq 3$, how many different sets can you sum the integer elements in the set to equal n ?
Constraints:
1) Each set must contain at least 2 elements.
2) All elements in a set must sum to $n$ (all elements must be greater than 0).
3) Normal set rules apply: No elements in a set can be repeated, and Order doesn't matter
Examples:
when n = 3 the only possible set is {1, 2} so the answer would be 1.
when n = 4 the only possible set is {1, 3} so the answer would be 1.
when n = 5 there are two sets {1, 4}, {2, 3} so the answer would be 2.
This is meant to be a programming question. I think the answer could be computed as a math equation, or at least a dynamic programming approach. My goal is for the run time to not exceed O(n), however O(1) would be great. If you want to provide code python like syntax would be fine.