Background
An ex-increasing set sequence of order \$N\$ is defined as a sequence of integer sets \$S_1,S_2,\cdots,S_n\$ which satisfies the following:
- Each \$S_i\$ is a non-empty subset of \$\{1,2,\cdots,N\}\$.
- For \$1\le i<n\$, \$S_i \cap S_{i+1} = \varnothing\$, i.e. any two consecutive sets have no elements in common.
- For \$1\le i<n\$, the mean (average value) of \$S_i\$ is strictly less than that of \$S_{i+1}\$.
Challenge
Given a positive integer N
, output the length of the longest ex-increasing set sequence of order N
.
Test cases
These are based on the results by Project Euler user thundre.
1 => 1 // {1}
2 => 2 // {1} {2}
3 => 3 // {1} {2} {3}
4 => 5 // {1} {2} {1,4} {3} {4}
5 => 7 // {1} {2} {1,4} {3} {2,5} {4} {5}
6 => 10 // {1} {2} {1,4} {3} {1,4,5} {2,3,6} {4} {3,6} {5} {6}
7 => 15 // {1} {2} {1,4} {3} {1,2,7} {3,4} {1,2,5,7} {4} {1,3,6,7} {4,5} {1,6,7} {5} {4,7} {6} {7}
8 => 21
9 => 29
10 => 39
11 => 49
12 => 63
13 => 79
14 => 99
15 => 121
16 => 145
17 => 171
18 => 203
19 => 237
20 => 277
21 => 321
22 => 369
23 => 419
24 => 477
25 => 537
Rules
Standard code-golf rules apply. The shortest valid submission in bytes wins.
Bounty
This problem has been discussed here on Project Euler forum about 4 years ago, but we failed to come up with a provable polynomial-time algorithm (in terms of N
). Therefore, I will award +200 bounty to the first submission that achieves this, or prove its impossibility.