wingstech
December 29th, 2006, 02:07 PM
Hi:
A number, for example 18, can be the sum of 3 single digit number:
1+8+9
2+7+9
2+8+8
...
6+6+6
For a number n from 10 to 81, is there an algorithm to find the largest set from single digit 1 to 9, in which, no matter which m element I pick up from the set, their sum can not be n? The m elements do not have to be unique. For example, if n=18 and m=3, then one possible set is {1, 2, 5, 9}. The algorithm must be as faster as possible.
A number, for example 18, can be the sum of 3 single digit number:
1+8+9
2+7+9
2+8+8
...
6+6+6
For a number n from 10 to 81, is there an algorithm to find the largest set from single digit 1 to 9, in which, no matter which m element I pick up from the set, their sum can not be n? The m elements do not have to be unique. For example, if n=18 and m=3, then one possible set is {1, 2, 5, 9}. The algorithm must be as faster as possible.