A351911 a(n) is the least integer m such that every m-element subset of {1,2,3,...,n} contains two nonempty and disjoint subsets whose sums are equal.
3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
Offset: 3
Examples
For n=3 we only have to check the subset {1,2,3} for which 1+2 = 3, and therefore a(3) = 3. For n=4 we first check the 3-element subsets, {1,2,3} : 1+2 = 3 {1,3,4} : 1+3 = 4 {1,2,4} : Fail. So we check the only 4-element subset {1,2,3,4} for which 1+2 = 3, and therefore a(4) = 4.
Links
- Thomas King, Disjoint subsets with same sum, Math StackExchange, 2021.
- Thomas King, Python program to compute the sequence by brute force
Crossrefs
Cf. A006127.
Programs
-
Python
# See Thomas King link.
Comments