Click to See Complete Forum and Search --> : looking for an Algorithm


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.

cilu
December 30th, 2006, 01:56 PM
[ redirected thread ]

kumaresh_ana
January 2nd, 2007, 05:52 AM
Problem can be stated more clearly. What is m you are talking about? What bounds the value of n as 10 to 81?

wingstech
January 2nd, 2007, 02:07 PM
m is the number of digits I can pick up from the set. n is an integer from 10 to 81.

TheCPUWizard
January 2nd, 2007, 07:09 PM
Use Occams Razor :D

kumaresh_ana
January 3rd, 2007, 01:14 AM
The m elements do not have to be unique
ok. I cannot quite get what do you mean by this.