Yotam
Yotam

Reputation: 10685

I don't understand element 103 from project Euler?

I am slowly solving my way though project Euler. I have reached problem 103 and I don't understand the criteria for the sets. The two rules given are (1), no two sets should have the same sum, (2), if a set has more elements than another, then its sum is higher as well. Under these two conditions, I would expect that these would be the optimal sums:

n=1:{1}
n=2:{1,2}
n=3:{1,2,3}
n=4:{1,2,3,4}
n=5:{1,2,3,4,5}
...

Where is my logic flawed?

Upvotes: 0

Views: 497

Answers (2)

antonio081014
antonio081014

Reputation: 3593

They are asking

any two non-empty disjoint subsets

Upvotes: 1

Gareth Latty
Gareth Latty

Reputation: 89087

The question states no subsets of the set can have the same sum, so in n=3, if we take the subsets {1, 2} and {3}, they have the same sum - 3.

I think you are comparing the whole sets against each other, while the question talks about subsets.

Upvotes: 3

Related Questions